|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.quadrique.jbuildingblocks.core.sound.JbbSoundHandler
public class JbbSoundHandler
This class provides convenience routine to manipulate sound files. The underlying implementation is based on the Java Sound APIs
| Method Summary | |
|---|---|
void |
addListener(JbbSoundHandlerListener zListener)
Call this method to register and to be notified of start/stop palying/recording events |
void |
createSoundFile()
|
AudioFormat |
getSoundFileFormat(File zFile)
|
byte[] |
getSoundFileRawDataByte(File zFile)
|
Exception |
hasProblemOcuredDuringPlay()
|
static JbbSoundHandler |
newInstance()
|
void |
removeListener(JbbSoundHandlerListener zListener)
Call this method to remove a previously registered listener |
void |
startPlaying(File zFile,
boolean zIsAsynchronous)
this method plays a sound file in a synchronous manner (i.e. |
void |
startRecording(File zFile,
boolean zUseCdQuality)
start recording to the given file. |
void |
stopPlaying()
|
void |
stopRecording()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static JbbSoundHandler newInstance()
public void startPlaying(File zFile,
boolean zIsAsynchronous)
throws Exception
zFile - the input sound filezIsAsynchronous - if true, the method kicks-off a separate thread and
returns as soon as the thread has been started. If false, the method plays
the sound file in its entirety before returning.
Exception - if an error occurspublic void stopPlaying()
Exceptionpublic Exception hasProblemOcuredDuringPlay()
public AudioFormat getSoundFileFormat(File zFile)
throws Exception
zFile - the input sound file
Exception - if an error occurs
public byte[] getSoundFileRawDataByte(File zFile)
throws Exception
zFile - the input file
Exception - if an error occurs
public void createSoundFile()
throws Exception
Exception
public void startRecording(File zFile,
boolean zUseCdQuality)
throws Exception
zFile - the file to use to save the recorded audiozUseCdQuality - true to record with CD quality (44,1 Khz, stereo, 16 bits)
or false to use 8Khz 8bit mono
Exception - if an error occurs
public void stopRecording()
throws Exception
Exception
public void addListener(JbbSoundHandlerListener zListener)
throws Exception
zListener - a reference to an instance of a class that implements the
SoundHandlerListener interface.
Exception - if an error occurspublic void removeListener(JbbSoundHandlerListener zListener)
zListener - a reference to an instance of a class that implements the
SoundHandlerListener interface.JbbSoundHandlerListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||