|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectddf.minim.AudioFileOut
ddf.minim.StreamFileOut
StreamFileOut using the Tritonus AudioOutputStream class to stream audio directly to disk. The limitation of this approach is that the file format and the file name must be known before recording begins because the file must be created. The advantage is that you do not incur the overhead of an in-memory buffer and saving will not cause your sketch to hang because all the audio is already on disk and all that must be done is closing the file. Unlike BufferedFileOut, specifying the file format upon saving will do nothing and you cannot easily save your recorded audio to multiple formats. There are also fewer formats available to save in, limiting you to AIFF, AU, and WAV.
| Field Summary | |
protected org.tritonus.share.sampled.file.AudioOutputStream |
aos
|
| Fields inherited from class ddf.minim.AudioFileOut |
AIFC, AIFF, AU, filename, fileType, format, recording, SND, WAV |
| Constructor Summary | |
StreamFileOut(javax.sound.sampled.AudioFormat format,
java.lang.String name)
Constructs a StreamFileOut that will record audio in the provided AudioFormat and save to a to a file called name. |
|
| Method Summary | |
void |
readSamples(org.tritonus.share.sampled.FloatSampleBuffer fsb)
Reads samples from fsb and writes them to the left and right AudioBuffers. |
void |
save()
Finishes the recording process by closing the file. |
void |
save(javax.sound.sampled.AudioFileFormat.Type type)
Finishes the recording process by closing the file. |
void |
setName(java.lang.String name)
Sets the name for the file. |
void |
setType(javax.sound.sampled.AudioFileFormat.Type type)
Sets the file type of the file. |
| Methods inherited from class ddf.minim.AudioFileOut |
isRecording, startRecording, stopRecording |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected org.tritonus.share.sampled.file.AudioOutputStream aos
| Constructor Detail |
public StreamFileOut(javax.sound.sampled.AudioFormat format,
java.lang.String name)
name.
format - the AudioFormat to record inname - the file name (do not include the extension)| Method Detail |
public void setName(java.lang.String name)
setName in class AudioFileOutname - the name of the file (without the extension)#setName(String)public void setType(javax.sound.sampled.AudioFileFormat.Type type)
setType in class AudioFileOuttype - #setType(javax.sound.sampled.AudioFileFormat.Type)public void save()
save in class AudioFileOut#save(),
#save()public void save(javax.sound.sampled.AudioFileFormat.Type type)
type
and simple calls save().
save in class AudioFileOuttype - the file format to save the recorded audio as#save(javax.sound.sampled.AudioFileFormat.Type),
#save(javax.sound.sampled.AudioFileFormat.Type)public void readSamples(org.tritonus.share.sampled.FloatSampleBuffer fsb)
ARListenerfsb and writes them to the left and right AudioBuffers.
Then mixes left and right in mix.
fsb - the FloatSampleBuffer to read from
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||