|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectddf.minim.Minim
The Minim class is how you get what you want from JavaSound.
There are methods for obtaining objects for playing audio files:
AudioSample, AudioSnippet, and AudioPlayer. There
are methods for obtaining an AudioRecorder, which is how you record
audio to disk. There are methods for obtaining an AudioInput, which
is how you can monitor the computer's line-in or microphone, depending on
what the user has set as the record source. Finally there are methods for
obtaining an AudioOutput, which is how you can play audio generated
by your program. All of these classes are given AudioStreams
by Minim, which are Threads that do the actual work
of audio I/O. Because of this, you should always call the close
method of an AudioXXX when you are finished with it.
Minim needs to know about your sketch so that it can load files
from the sketches data directory. For this reason, before you do anything with
Minim, you must call start.
| Field Summary | |
static javax.sound.sampled.AudioFileFormat.Type |
AIFC
The .aifc file format. |
static javax.sound.sampled.AudioFileFormat.Type |
AIFF
The .aiff file format. |
static javax.sound.sampled.AudioFileFormat.Type |
AU
The .au file format. |
static int |
MONO
Specifies that you want a MONO AudioInput or AudioOutput |
static javax.sound.sampled.AudioFileFormat.Type |
SND
The .snd file format. |
static int |
STEREO
Specifies that you want a STEREO AudioInput or AudioOutput |
static javax.sound.sampled.AudioFileFormat.Type |
WAV
The .wav file format. |
| Method Summary | |
static AudioRecorder |
createRecorder(Recordable source,
java.lang.String fileName,
boolean buffered)
Creates an AudioRecorder that will use source as its
record source and that will save to the file name specified. |
static void |
debug(java.lang.String s)
Displays a debug message, but only if debugOn() has been called. |
static void |
debugOff()
Turns off debug messages. |
static void |
debugOn()
Turns on debug messages. |
static void |
error(java.lang.String s)
Used internally to report error messages. |
static AudioInput |
getLineIn()
Gets an AudioInput, to which you can attach AudioEffects. |
static AudioInput |
getLineIn(int type)
Gets an AudioInput, to which you can attach AudioEffects. |
static AudioInput |
getLineIn(int type,
int bufferSize)
Gets an AudioInput, to which you can attach AudioEffects. |
static AudioInput |
getLineIn(int type,
int bufferSize,
float sampleRate)
Gets an AudioInput, to which you can attach AudioEffects. |
static AudioInput |
getLineIn(int type,
int bufferSize,
float sampleRate,
int bitDepth)
Gets an AudioInput, to which you can attach AudioEffects. |
static AudioOutput |
getLineOut()
Gets an AudioOutput, to which you can attach
AudioSignals and AudioEffects. |
static AudioOutput |
getLineOut(int type)
Gets an AudioOutput, to which you can attach
AudioSignals and AudioEffects. |
static AudioOutput |
getLineOut(int type,
int bufferSize)
Gets an AudioOutput, to which you can attach
AudioSignals and AudioEffects. |
static AudioOutput |
getLineOut(int type,
int bufferSize,
float sampleRate)
Gets an AudioOutput, to which you can attach
AudioSignals and AudioEffects. |
static AudioOutput |
getLineOut(int type,
int bufferSize,
float sampleRate,
int bitDepth)
Gets an AudioOutput, to which you can attach
AudioSignals and AudioEffects. |
static AudioPlayer |
loadFile(java.lang.String filename)
Loads the requested file into an AudioPlayer
with a buffer size of 1024 samples. |
static AudioPlayer |
loadFile(java.lang.String filename,
int bufferSize)
Loads the requested file into an AudioPlayer with
the request buffer size. |
static AudioSample |
loadSample(java.lang.String filename)
Loads the requested file into an AudioSample. |
static AudioSample |
loadSample(java.lang.String filename,
int bufferSize)
Loads the requested file into an AudioSample. |
static AudioSnippet |
loadSnippet(java.lang.String filename)
Loads the requested file into an AudioSnippet |
static void |
start(processing.core.PApplet pro)
Starts Minim. |
static void |
stop()
Deprecated. This does nothing now, be sure to call close on
anything you get from Minim. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int MONO
public static final int STEREO
public static javax.sound.sampled.AudioFileFormat.Type WAV
public static javax.sound.sampled.AudioFileFormat.Type AIFF
public static javax.sound.sampled.AudioFileFormat.Type AIFC
public static javax.sound.sampled.AudioFileFormat.Type AU
public static javax.sound.sampled.AudioFileFormat.Type SND
| Method Detail |
public static void error(java.lang.String s)
s - the error message to reportpublic static void debug(java.lang.String s)
debugOn() has been called.
The message will be displayed in the console area of the PDE,
if you are running your sketch from the PDE.
Otherwise, it will be displayed in the Java Console.
s - the message to displaydebugOn()public static void debugOn()
public static void debugOff()
public static void start(processing.core.PApplet pro)
pro - the sketch that is going to be using Minimpublic static void stop()
close on
anything you get from Minim.
public static AudioSample loadSample(java.lang.String filename)
AudioSample.
filename - the file or URL that you want to load
AudioSample with a 1024 sample bufferloadSample(String, int),
AudioSample
public static AudioSample loadSample(java.lang.String filename,
int bufferSize)
AudioSample.
filename - the file or URL that you want to loadbufferSize - the sample buffer size you want
AudioSample with a sample buffer of the requested sizepublic static AudioSnippet loadSnippet(java.lang.String filename)
AudioSnippet
filename - the file or URL you want to load
AudioSnippet of the requested file or URLpublic static AudioPlayer loadFile(java.lang.String filename)
AudioPlayer
with a buffer size of 1024 samples.
filename - the file or URL you want to load
AudioPlayer with a 1024 sample bufferloadFile(String, int)
public static AudioPlayer loadFile(java.lang.String filename,
int bufferSize)
AudioPlayer with
the request buffer size.
filename - the file or URL you want to loadbufferSize - the sample buffer size you want
AudioPlayer with a sample buffer of the requested size
public static AudioRecorder createRecorder(Recordable source,
java.lang.String fileName,
boolean buffered)
AudioRecorder that will use source as its
record source and that will save to the file name specified. The format of the
file will be inferred from the extension in the file name. If the extension is
not a recognized file type, this will return null. Be aware that if you choose
buffered recording the call to AudioRecorder.save() will block until
the entire buffer is written to disk. In the event that the buffer is very large,
your sketch will noticably hang.
source - the Recordable object you want to use as a record sourcefileName - the name of the file to record tobuffered - whether or not to use buffered recording
AudioRecorder for the record sourcepublic static AudioInput getLineIn()
AudioInput, to which you can attach AudioEffects.
AudioInput with a 1024 sample buffer, a sample rate of
44100 and a bit depth of 16getLineIn(int, int, float, int)public static AudioInput getLineIn(int type)
AudioInput, to which you can attach AudioEffects.
type - Minim.MONO or Minim.STEREO
AudioInput with the requested type, a 1024 sample buffer, a
sample rate of 44100 and a bit depth of 16getLineIn(int, int, float, int)
public static AudioInput getLineIn(int type,
int bufferSize)
AudioInput, to which you can attach AudioEffects.
type - Minim.MONO or Minim.STEREObufferSize - how long you want the AudioInput's sample buffer to be
AudioInput with the requested attributes, a sample rate of 44100
and a bit depth of 16getLineIn(int, int, float, int)
public static AudioInput getLineIn(int type,
int bufferSize,
float sampleRate)
AudioInput, to which you can attach AudioEffects.
type - Minim.MONO or Minim.STEREObufferSize - how long you want the AudioInput's sample buffer to besampleRate - the desired sample rate in Hertz (typically 44100)
AudioInput with the requested attributes and a bit depth of 16getLineIn(int, int, float, int)
public static AudioInput getLineIn(int type,
int bufferSize,
float sampleRate,
int bitDepth)
AudioInput, to which you can attach AudioEffects.
type - Minim.MONO or Minim.STEREObufferSize - how long you want the AudioInput's sample buffer to besampleRate - the desired sample rate in Hertz (typically 44100)bitDepth - the desired bit depth (typically 8)
AudioInput with the requested attributespublic static AudioOutput getLineOut()
AudioOutput, to which you can attach
AudioSignals and AudioEffects.
AudioOutput with a 1024 sample buffer, a sample rate of
44100 and a bit depth of 16getLineOut(int, int, float, int)public static AudioOutput getLineOut(int type)
AudioOutput, to which you can attach
AudioSignals and AudioEffects.
type - Minim.MONO or Minim.STEREO
AudioOutput with the requested type, a 1024 sample buffer, a
sample rate of 44100 and a bit depth of 16getLineOut(int, int, float, int)
public static AudioOutput getLineOut(int type,
int bufferSize)
AudioOutput, to which you can attach
AudioSignals and AudioEffects.
type - Minim.MONO or Minim.STEREObufferSize - how long you want the AudioOutput's sample buffer to be
AudioOutput with the requested attributes, a sample rate of
44100 and a bit depth of 16getLineOut(int, int, float, int)
public static AudioOutput getLineOut(int type,
int bufferSize,
float sampleRate)
AudioOutput, to which you can attach
AudioSignals and AudioEffects.
type - Minim.MONO or Minim.STEREObufferSize - how long you want the AudioOutput's sample buffer to besampleRate - the desired sample rate in Hertz (typically 44100)
AudioOutput with the requested attributes and a bit depth of 16getLineOut(int, int, float, int)
public static AudioOutput getLineOut(int type,
int bufferSize,
float sampleRate,
int bitDepth)
AudioOutput, to which you can attach
AudioSignals and AudioEffects.
type - Minim.MONO or Minim.STEREObufferSize - how long you want the AudioOutput's sample buffer to besampleRate - the desired sample rate in Hertz (typically 44100)bitDepth - the desired bit depth (typically 8)
AudioOutput with the requested attributes
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||