FileDocCategorySizeDatePackage
NativeTonePlayer.javaAPI DocphoneME MR2 API (J2ME)2205Wed May 02 16:47:10 BST 2007com.sun.mmedia

NativeTonePlayer

public class NativeTonePlayer extends Object implements com.sun.mmedia.TonePlayer
Tone Player to play a single note of specified duration and at the specified volume.
created
January 13, 2005

Fields Summary
Constructors Summary
Methods Summary
private native voidfinalize()

private native booleannPlayTone(int note, int dur, int vol)
The native implementation method to play a tone.

param
note Defines the tone of the note.
param
dur The duration of the tone in milli-seconds.
param
vol Audio volume range from 0 to 100.
return
the tone player handle, or 0 if it failed to play the tone

private native booleannStopTone()

public voidplayTone(int note, int duration, int volume)

        
        if (false == nPlayTone(note, duration, volume)) {
            throw new MediaException("can't play tone");
        }
    
public voidstopTone()
Stop current tone playing

        nStopTone();