|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MinimServiceProvider
MinimServiceProvider
is the interface that an audio implementation must
provide to Minim
, to guarantee that it can provide all of the functionality
that Minim promises. All of the interfaces in this package define functionality in the
most minimal way possible, to make it easy for people write their own implementations, since
much of what Minim provides can be done so without regard for the details of audio intput and
output. If you write your own implementation of this interface, or if you are using one that
someone else has written, all you must do is pass an instantiation of it to the Minim
constructor. That Minim object will then delegate most of the work to the implementation.
Method Summary | |
---|---|
void |
debugOff()
Tells the implementation it should not produce debug output. |
void |
debugOn()
Tells the implementation it should produce debug output, if that's something it does. |
AudioStream |
getAudioInput(int type,
int bufferSize,
float sampleRate,
int bitDepth)
Should return an AudioStream with the requested parameters. |
AudioOut |
getAudioOutput(int type,
int bufferSize,
float sampleRate,
int bitDepth)
Should return an AudioOut that can be used to generate audio that will
be heard through the computer's speakers. |
AudioRecording |
getAudioRecording(java.lang.String filename)
Deprecated. |
AudioRecordingStream |
getAudioRecordingStream(java.lang.String filename,
int bufferSize,
boolean inMemory)
Should return an AudioRecordingStream that will stream the file requested. |
AudioSample |
getAudioSample(float[] samples,
javax.sound.sampled.AudioFormat format,
int bufferSize)
Should return an AudioSample that will store the provided samples. |
AudioSample |
getAudioSample(float[] left,
float[] right,
javax.sound.sampled.AudioFormat format,
int bufferSize)
Should return an AudioSample that will store the provided samples. |
AudioSample |
getAudioSample(java.lang.String filename,
int bufferSize)
Should return an AudioSample that will load the requested file into memory. |
SampleRecorder |
getSampleRecorder(Recordable source,
java.lang.String saveTo,
boolean buffered)
Should return a SampleRecorder that can record the source in a
buffered (in-memory) or non-buffered (streamed) manner, to the file specified by saveTo |
void |
start()
Called inside the Minim constructor. |
void |
stop()
Called when stop() is called by the Minim object that owns this. |
Method Detail |
---|
void start()
void stop()
stop()
is called by the Minim object that owns this.
Implementations should release all resources and stop all Threads at this time.
void debugOn()
void debugOff()
AudioRecording getAudioRecording(java.lang.String filename)
AudioRecordingStream getAudioRecordingStream(java.lang.String filename, int bufferSize, boolean inMemory)
AudioRecordingStream
that will stream the file requested. The filename
could be a URL, an absolute path, or just a filename that the user expects the system to find
in their sketch somewhere.
filename
- the name of the file to load into the AudioRecordingStreambufferSize
- the bufferSize to use in memory (implementations are free to ignore this, if they must)inMemory
- TODO
AudioStream getAudioInput(int type, int bufferSize, float sampleRate, int bitDepth)
AudioStream
with the requested parameters. What Minim is
expecting this stream to be reading from is the active audio input of the computer,
such as the microphone or line-in.
type
- Minim.STEREO or Minim.MONObufferSize
- how big the in-memory buffer should besampleRate
- what the sample rate of the stream should bebitDepth
- what the bit depth of the stream should be
AudioOut getAudioOutput(int type, int bufferSize, float sampleRate, int bitDepth)
AudioOut
that can be used to generate audio that will
be heard through the computer's speakers.
type
- Minim.STEREO or Minim.MONObufferSize
- how big the in-memory buffer should besampleRate
- what the sample rate of the generated audio should bebitDepth
- what the bit depth of the generated audio should be
AudioSample getAudioSample(java.lang.String filename, int bufferSize)
AudioSample
that will load the requested file into memory.
filename
- the name of the file to load, this might be a URL, an absolute path, or a
file that the user expects the implementation to find in their sketch somewhere.bufferSize
- how big the output buffer used for playing the sample should be
AudioSample getAudioSample(float[] samples, javax.sound.sampled.AudioFormat format, int bufferSize)
AudioSample
that will store the provided samples.
samples
- the array of audio samplesbufferSize
- how large the output buffer should be
AudioSample getAudioSample(float[] left, float[] right, javax.sound.sampled.AudioFormat format, int bufferSize)
AudioSample
that will store the provided samples.
left
- the left channel of the stereo sampleright
- the right channel of a stereo samplebufferSize
- how large the output buffer should be
SampleRecorder getSampleRecorder(Recordable source, java.lang.String saveTo, boolean buffered)
SampleRecorder
that can record the source
in a
buffered (in-memory) or non-buffered (streamed) manner, to the file specified by saveTo
source
- the audio source that should be recordedsaveTo
- the file to save the recorded audio tobuffered
- whether or not to buffer all recorded audio in memory or stream directly to the file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |