Minim index
Name AudioRecorder
Examples
None available
Description An AudioRecorder can be used to record audio that is being played by a Recordable object. An AudioRecorder need not necessarily record to disk, but the recorders you receive from {@link Minim#createRecorder(Recordable, String, boolean)} will do so. If you'd like to save a file somewhere other than the sketches root folder, you can constructor an AudioRecorder directly, using an absolute path for the filename (such as "C:\My Documents\Music\song.wav"). You can also create a recorder that uses your own implementation of {@link SampleRecorder} (like if you wanted to implement an mp3 encoder).
Constructors
AudioRecorder(recordSource, recorder);
Parameters
recordSource   the Recordable object to record
recorder   the SampleRecorder to use to record it
Methods
beginRecord ( )   Begins recording audio from the current record source. If recording was previously halted, and {@link #save()} was not called, samples will be appended to the end of the material recorded so far.

endRecord ( )   Halts the recording of audio from the current record source.

isRecording ( )   Returns the current record state.

save ( )   Requests the current SampleRecorder to save. This will only work if you have called {@link #endRecord()}. If this was created with a buffered recorder, then calling {@link #beginRecord()} after saving will not overwrite the file on the disk, unless this method is subsequently called. However, if this was created with an unbuffered recorder, it is likely that a call to {@link #beginRecord()} will create the file again, overwriting the file that had previously been saved. An AudioRecording will be returned if the SampleRecorder used to record the audio saved to a file (this will always be the case if you use createRecorder or the first constructor for AudioRecorder).

setRecordSource ( )   Sets the record source for this recorder. The record source can be set at any time, though in practice it is probably a good idea to mute the old record source, then add the new record source, also muted, and then unmute the new record source. Otherwise, you'll probably wind up with a pop in the recording.

setSampleRecorder ( )   Sets the SampleRecorder for this recorder. Similar caveats apply as with {@link #setRecordSource(Recordable)}. This calls endRecord and save on the current SampleRecorder before setting the new one.

Usage Web & Application
Related