|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ddf.minim.AudioRecorder
public class AudioRecorder
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
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
SampleRecorder
(like if you wanted to implement an mp3 encoder).
Constructor Summary | |
---|---|
AudioRecorder(Recordable recordSource,
SampleRecorder recorder)
Constructs an AudioRecorder that will use
recorder to record recordSource . |
Method Summary | |
---|---|
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. |
AudioRecordingStream |
save()
Requests the current SampleRecorder to save. |
void |
setRecordSource(Recordable recordSource)
Sets the record source for this recorder. |
void |
setSampleRecorder(SampleRecorder recorder)
Sets the SampleRecorder for this recorder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AudioRecorder(Recordable recordSource, SampleRecorder recorder)
AudioRecorder
that will use
recorder
to record recordSource
.
recordSource
- the Recordable
object to recordrecorder
- the SampleRecorder
to use to record itMethod Detail |
---|
public void beginRecord()
save()
was not called, samples will be
appended to the end of the material recorded so far.
public void endRecord()
public boolean isRecording()
public AudioRecordingStream save()
SampleRecorder
to save. This will only
work if you have called endRecord()
. If this was created with a
buffered recorder, then calling 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 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
).
AudioPlayer
public void setRecordSource(Recordable recordSource)
recordSource
- the new record sourcepublic void setSampleRecorder(SampleRecorder recorder)
SampleRecorder
for this recorder. Similar caveats
apply as with setRecordSource(Recordable)
. This calls
endRecord
and save
on the current
SampleRecorder
before setting the new one.
recorder
- the new SampleRecorder
to use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |