|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--jfrace.device.WaveTablePlayer
Audio player based on a wave table. The player uses the undocumented
audio player sun.audio.AudioPlayer.
The sun.audio package is part of every JDK and of
Java implementation of (presumably) all web browsers supporting
Java. Note that sun.audio.AudioPlayer plays only
8000 Hz sampled u-law encoded audio data. The method
setWaveTable automatically encodes the data.
| Field Summary | |
protected byte[] |
waveTable
Byte array of the wave table. |
| Constructor Summary | |
WaveTablePlayer(int size)
Create an instance with a given size of the wave table. |
|
| Method Summary | |
int |
getLength()
Return the length of the current wave form. |
int |
getSize()
Return the size of the wave table. |
boolean |
isPlaying()
Return the playing flag. |
protected static byte |
linear2ulaw(int pcm_val)
Linear 2 byte to 1 byte u-law. |
void |
play()
Start playing and set the playing flag. |
protected void |
setLength(int value)
Set the length of the actual wave form |
void |
setWaveTable(int[] waveForm)
Set the wave form of the wave table. |
void |
stop()
Stop playing and reset the playing flag. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected byte[] waveTable
| Constructor Detail |
public WaveTablePlayer(int size)
size - Wave table size, i.e. the maximum number of bytes
a wave form can have.| Method Detail |
protected static byte linear2ulaw(int pcm_val)
pcm_val - 16 bit linear valuepublic int getSize()
public int getLength()
protected void setLength(int value)
public void setWaveTable(int[] waveForm)
waveForm - Array of the wave form.public void play()
public boolean isPlaying()
public void stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||