|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectddf.minim.javasound.JSMinim
public class JSMinim
JSMinim is an implementation of the MinimServiceProvider
interface that use
Javasound to provide all audio functionality. That's about all you really need to know about it.
Constructor Summary | |
---|---|
JSMinim(processing.core.PApplet parent)
|
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. |
AudioRecording |
getAudioRecording(java.lang.String filename)
Should return an AudioRecording that can play the file requested. |
AudioRecording |
getAudioRecordingClip(java.lang.String filename)
|
AudioRecordingStream |
getAudioRecordingStream(java.lang.String filename,
int bufferSize)
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. |
AudioStream |
getAudioStream(int type,
int bufferSize,
float sampleRate,
int bitDepth)
Should return an AudioStream with the requested parameters. |
AudioSynthesizer |
getAudioSynthesizer(int type,
int bufferSize,
float sampleRate,
int bitDepth)
Should return an AudioSynthesizer that can generate audio that will be heard through
the computer's speakers. |
javax.sound.sampled.Mixer |
getInputMixer()
|
javax.sound.sampled.Mixer |
getOutputMixer()
|
SampleRecorder |
getSampleRecorder(Recordable source,
java.lang.String fileName,
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 |
setInputMixer(javax.sound.sampled.Mixer mix)
|
void |
setOutputMixer(javax.sound.sampled.Mixer mix)
|
void |
start()
Called inside the Minim constructor. |
void |
stop()
Called when stop() is called by the Minim object that owns this. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSMinim(processing.core.PApplet parent)
Method Detail |
---|
public void setInputMixer(javax.sound.sampled.Mixer mix)
public javax.sound.sampled.Mixer getInputMixer()
public void setOutputMixer(javax.sound.sampled.Mixer mix)
public javax.sound.sampled.Mixer getOutputMixer()
public void start()
MinimServiceProvider
start
in interface MinimServiceProvider
public void stop()
MinimServiceProvider
stop()
is called by the Minim object that owns this.
Implementations should release all resources and stop all Threads at this time.
stop
in interface MinimServiceProvider
public void debugOn()
MinimServiceProvider
debugOn
in interface MinimServiceProvider
public void debugOff()
MinimServiceProvider
debugOff
in interface MinimServiceProvider
public SampleRecorder getSampleRecorder(Recordable source, java.lang.String fileName, boolean buffered)
MinimServiceProvider
SampleRecorder
that can record the source
in a
buffered (in-memory) or non-buffered (streamed) manner, to the file specified by saveTo
getSampleRecorder
in interface MinimServiceProvider
source
- the audio source that should be recordedfileName
- the file to save the recorded audio tobuffered
- whether or not to buffer all recorded audio in memory or stream directly to the file
public AudioRecordingStream getAudioRecordingStream(java.lang.String filename, int bufferSize)
MinimServiceProvider
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.
getAudioRecordingStream
in interface MinimServiceProvider
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)
public AudioStream getAudioStream(int type, int bufferSize, float sampleRate, int bitDepth)
MinimServiceProvider
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.
getAudioStream
in interface MinimServiceProvider
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
public AudioSample getAudioSample(java.lang.String filename, int bufferSize)
MinimServiceProvider
AudioSample
that will load the requested file into memory.
getAudioSample
in interface MinimServiceProvider
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
public AudioSample getAudioSample(float[] samples, javax.sound.sampled.AudioFormat format, int bufferSize)
MinimServiceProvider
AudioSample
that will store the provided samples.
getAudioSample
in interface MinimServiceProvider
samples
- the array of audio samplesbufferSize
- how large the output buffer should be
public AudioSample getAudioSample(float[] left, float[] right, javax.sound.sampled.AudioFormat format, int bufferSize)
MinimServiceProvider
AudioSample
that will store the provided samples.
getAudioSample
in interface MinimServiceProvider
left
- the left channel of the stereo sampleright
- the right channel of a stereo samplebufferSize
- how large the output buffer should be
public AudioSynthesizer getAudioSynthesizer(int type, int bufferSize, float sampleRate, int bitDepth)
MinimServiceProvider
AudioSynthesizer
that can generate audio that will be heard through
the computer's speakers.
getAudioSynthesizer
in interface MinimServiceProvider
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
public AudioRecording getAudioRecordingClip(java.lang.String filename)
public AudioRecording getAudioRecording(java.lang.String filename)
MinimServiceProvider
AudioRecording
that can play 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.
getAudioRecording
in interface MinimServiceProvider
filename
- the name of the file to load into the AudioRecording
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |