|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.aplu.util.SoundRecorder
public class SoundRecorder
Class for recording sound and save it to a WAV file.
Constructor Summary | |
---|---|
SoundRecorder(javax.sound.sampled.AudioFormat audioFormat)
Create a recorder instance with given audioFormat using the default sound device. |
|
SoundRecorder(javax.sound.sampled.AudioFormat audioFormat,
int mixerIndex)
|
|
SoundRecorder(int bufSize,
javax.sound.sampled.AudioFormat audioFormat)
Create a recorder instance with given audioFormat using the default sound device. |
|
SoundRecorder(int bufSize,
javax.sound.sampled.AudioFormat audioFormat,
int mixerIndex)
Create a recorder instance with given audioFormat using the given mixer index (sound device). |
Method Summary | |
---|---|
void |
addSoundSampleListener(SoundSampleListener listener)
|
void |
capture(java.io.ByteArrayOutputStream data)
Start capturing the sound in a separate capture thread and store data in the given stream. |
static java.lang.String[] |
getAvailableMixers()
Return a list of the names of available mixers (sound devices). |
int |
getMixerIndex()
|
void |
stopCapture()
Stop the capturing process and return after the capture thread terminates. |
void |
writeWavFile(java.io.ByteArrayOutputStream data,
java.io.File file)
Write the sound data in the given stream into the given file in WAV format. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SoundRecorder(javax.sound.sampled.AudioFormat audioFormat)
public SoundRecorder(int bufSize, javax.sound.sampled.AudioFormat audioFormat)
public SoundRecorder(javax.sound.sampled.AudioFormat audioFormat, int mixerIndex)
public SoundRecorder(int bufSize, javax.sound.sampled.AudioFormat audioFormat, int mixerIndex)
Method Detail |
---|
public void addSoundSampleListener(SoundSampleListener listener)
public void capture(java.io.ByteArrayOutputStream data) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
- if the sound card is not availablepublic void stopCapture()
public void writeWavFile(java.io.ByteArrayOutputStream data, java.io.File file)
public static java.lang.String[] getAvailableMixers()
public int getMixerIndex()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |