|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.audio.SimpleTonePlayer
public class SimpleTonePlayer
A simple mechanism for generating audio tones. A single SimpleTonePlayer can play up to 15 tones simultaneously. For more tones, use a second SimpleTonePlayer.
| Constructor Summary | |
|---|---|
SimpleTonePlayer()
Creates a new SimpleTonePlayer. |
|
SimpleTonePlayer(boolean preallocate)
Creates a new SimpleTonePlayer. |
|
| Method Summary | |
|---|---|
void |
destroy()
Frees as many resources as possible that are currently held by this object. |
void |
playTone(int note,
int duration,
int volume)
Plays a single tone at a particular volume and for a specified duration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleTonePlayer()
Sequence
public SimpleTonePlayer(boolean preallocate)
throws AudioException
preallocate - whether to pre-allocate a Sequence
AudioException - if the Sequence cannot be allocatedSequence| Method Detail |
|---|
public void destroy()
public void playTone(int note,
int duration,
int volume)
throws AudioException
note - the MIDI note to playduration - the length of the note, in millisecondsvolume - the volume of the note on a linear scale, where 0 is
silence, and 100 is maximum volume
AudioException - if all channels are currently in use
IllegalArgumentException - if note is less than 0 or greater
than 127, or if duration is less than or equal to 0
IllegalStateException - if this object has been destroyed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||