public class AudioRecorder
extends java.lang.Object
AudioRecorder
can be used to record audio that is being
played by a Recordable
object such as an AudioOutput
,
AudioInput
, or AudioPlayer
. An AudioRecorder
need not necessarily record to disk, but the recorders you receive from
Minim's createRecorder method will do so.Constructor and Description |
---|
AudioRecorder(Recordable recordSource,
ddf.minim.spi.SampleRecorder recorder) |
Modifier and Type | Method and Description |
---|---|
void |
beginRecord()
Begins recording audio from the current record source.
|
void |
endRecord()
Halts the recording of audio from the current record source.
|
boolean |
isRecording()
Returns the current record state.
|
ddf.minim.spi.AudioRecordingStream |
save()
Requests that the recorder saves.
|
void |
setRecordSource(Recordable recordSource)
Sets the record source for this recorder.
|
void |
setSampleRecorder(ddf.minim.spi.SampleRecorder recorder) |
public AudioRecorder(Recordable recordSource, ddf.minim.spi.SampleRecorder recorder)
recordSource
- the Recordable
object to recordrecorder
- the SampleRecorder
to use to record itpublic void beginRecord()
public void endRecord()
public boolean isRecording()
public ddf.minim.spi.AudioRecordingStream save()
AudioRecordingStream
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
).AudioRecordingStream
public void setRecordSource(Recordable recordSource)
recordSource
- an AudioSample, AudioPlayer, AudioInput, or AudioOutputpublic void setSampleRecorder(ddf.minim.spi.SampleRecorder recorder)
recorder
- the new SampleRecorder
to use