com.cloudgarden.audio
Class AudioFileSink
java.lang.Object
|
+--com.cloudgarden.audio.DefaultAudioObject
|
+--com.cloudgarden.audio.DefaultAudioSink
|
+--com.cloudgarden.audio.AudioFileSink
- All Implemented Interfaces:
- AudioObject, AudioSink
- public class AudioFileSink
- extends DefaultAudioSink
AudioSink wrapper for a File, enabling audio data to be written to a File.
Constructor Summary |
AudioFileSink(java.io.File file,
javax.sound.sampled.AudioFileFormat fileFormat)
|
AudioFileSink(java.io.File file,
javax.sound.sampled.AudioFormat format,
javax.sound.sampled.AudioFileFormat.Type fileType)
|
AudioFileSink(java.io.File file,
AudioSource src,
javax.sound.sampled.AudioFileFormat.Type fileType)
Creates an AudioFileSink to receive data from the given AudioSource, with the same AudioFormat as
the AudioSource, and the given fileType. |
Method Summary |
int |
write(byte[] data,
int offset,
int length)
This method will write audio data to an internal buffer until it is called with
END_OF_DATA as it's length parameter, at which point it will
write all the stored data to the file. |
Methods inherited from class com.cloudgarden.audio.DefaultAudioObject |
addTransferListener, blockWhilePaused, blockWhileWaiting, bytesTransferred, canSetAudioFormat, drain, getAudioFormat, getContentType, getLastException, isPaused, isWaiting, removeTransferListener, setPaused |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AudioFileSink
public AudioFileSink(java.io.File file,
javax.sound.sampled.AudioFileFormat fileFormat)
AudioFileSink
public AudioFileSink(java.io.File file,
javax.sound.sampled.AudioFormat format,
javax.sound.sampled.AudioFileFormat.Type fileType)
AudioFileSink
public AudioFileSink(java.io.File file,
AudioSource src,
javax.sound.sampled.AudioFileFormat.Type fileType)
throws java.io.IOException
- Creates an AudioFileSink to receive data from the given AudioSource, with the same AudioFormat as
the AudioSource, and the given fileType.
write
public int write(byte[] data,
int offset,
int length)
throws java.io.IOException
- This method will write audio data to an internal buffer until it is called with
END_OF_DATA as it's length parameter, at which point it will
write all the stored data to the file.
- Following copied from interface:
com.cloudgarden.audio.AudioSink
- See Also:
AudioSink.setSource(com.cloudgarden.audio.AudioSource)
,
AudioSource.startSending()
,
AudioObject.setPaused(boolean)