|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.golden.gamedev.engine.audio.WaveRenderer3
Play wave (*.wav; *.au), and midi (*.mid) sound.
Experimental renderer.
Since this class not implement the essential isPlaying()
method
(don't know yet how to implement this),
BaseAudio
that use this class as
the sample renderer will attempt to create new renderer for every
playing sound.
If there're too many renderers created,
it can cause buffer overflow.
Note:
Midi sound use soundbank that not delivered in JRE,
only JDK can play midi sound.
To play midi in JRE you must explicitly install soundbank.
Don't ask me how, i don't know either, please read JDK documentation.
Constructor Summary | |
WaveRenderer3()
|
Method Summary | |
BaseAudioRenderer |
createRenderer()
Creates another empty renderer based on this renderer. |
URL |
getAudioFile()
Returns the audio file associated with this audio renderer. |
float |
getVolume()
Returns this audio volume. |
boolean |
isPlaying()
Returns true, if this audio is currently playing. |
void |
play()
Begins playback of this audio renderer. |
void |
play(URL audiofile)
Begins playback of specified audio file. |
void |
setLoop(boolean b)
The sound is playing continuously until stop is called. |
void |
setVolume(float volume)
Sets audio volume in [0.0f - 1.0f]. |
void |
stop()
Stops currently played audio. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WaveRenderer3()
Method Detail |
public URL getAudioFile()
BaseAudioRenderer
getAudioFile
in interface BaseAudioRenderer
public boolean isPlaying()
BaseAudioRenderer
isPlaying
in interface BaseAudioRenderer
public void play(URL audiofile)
BaseAudioRenderer
play
in interface BaseAudioRenderer
audiofile
- the audio file to be played by this renderer.public void play()
BaseAudioRenderer
play
in interface BaseAudioRenderer
public void stop()
BaseAudioRenderer
stop
in interface BaseAudioRenderer
public void setVolume(float volume)
BaseAudioRenderer
setVolume
in interface BaseAudioRenderer
public float getVolume()
BaseAudioRenderer
getVolume
in interface BaseAudioRenderer
public BaseAudioRenderer createRenderer()
BaseAudioRenderer
createRenderer
in interface BaseAudioRenderer
public void setLoop(boolean b)
BaseAudioRenderer
Note: if the internal renderer doesn't support built-in loop, please use thread that wait the sound ended and restart the sound.
setLoop
in interface BaseAudioRenderer
b
- true, the audio is playing continously.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |