ToneGeneratorpublic class ToneGenerator extends Object This class provides methods to play DTMF tones (ITU-T Recommendation Q.23),
call supervisory tones (3GPP TS 22.001, CEPT) and proprietary tones (3GPP TS 31.111).
Depending on call state and routing options, tones are mixed to the downlink audio
or output to the speaker phone or headset.
This API is not for generating tones over the uplink audio path. |
Fields Summary |
---|
public static final int | TONE_DTMF_0DTMF tone for key 0: 1336Hz, 941Hz, continuous | public static final int | TONE_DTMF_1DTMF tone for key 1: 1209Hz, 697Hz, continuous | public static final int | TONE_DTMF_2DTMF tone for key 2: 1336Hz, 697Hz, continuous | public static final int | TONE_DTMF_3DTMF tone for key 3: 1477Hz, 697Hz, continuous | public static final int | TONE_DTMF_4DTMF tone for key 4: 1209Hz, 770Hz, continuous | public static final int | TONE_DTMF_5DTMF tone for key 5: 1336Hz, 770Hz, continuous | public static final int | TONE_DTMF_6DTMF tone for key 6: 1477Hz, 770Hz, continuous | public static final int | TONE_DTMF_7DTMF tone for key 7: 1209Hz, 852Hz, continuous | public static final int | TONE_DTMF_8DTMF tone for key 8: 1336Hz, 852Hz, continuous | public static final int | TONE_DTMF_9DTMF tone for key 9: 1477Hz, 852Hz, continuous | public static final int | TONE_DTMF_SDTMF tone for key *: 1209Hz, 941Hz, continuous | public static final int | TONE_DTMF_PDTMF tone for key #: 1477Hz, 941Hz, continuous | public static final int | TONE_DTMF_ADTMF tone for key A: 1633Hz, 697Hz, continuous | public static final int | TONE_DTMF_BDTMF tone for key B: 1633Hz, 770Hz, continuous | public static final int | TONE_DTMF_CDTMF tone for key C: 1633Hz, 852Hz, continuous | public static final int | TONE_DTMF_DDTMF tone for key D: 1633Hz, 941Hz, continuous | public static final int | TONE_SUP_DIALCall supervisory tone, Dial tone: 425Hz, continuous | public static final int | TONE_SUP_BUSYCall supervisory tone, Busy: 425Hz, 500ms ON, 500ms OFF... | public static final int | TONE_SUP_CONGESTIONCall supervisory tone, Congestion: 425Hz, 200ms ON, 200ms OFF... | public static final int | TONE_SUP_RADIO_ACKCall supervisory tone, Radio path acknowlegment : 425Hz, 200ms ON | public static final int | TONE_SUP_RADIO_NOTAVAILCall supervisory tone, Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts | public static final int | TONE_SUP_ERRORCall supervisory tone, Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF... | public static final int | TONE_SUP_CALL_WAITINGCall supervisory tone, Call Waiting: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF... | public static final int | TONE_SUP_RINGTONECall supervisory tone, Ring Tone: 425Hz, 1s ON, 4s OFF... | public static final int | TONE_PROP_BEEPProprietary tone, general beep: 400Hz+1200Hz, 35ms ON | public static final int | TONE_PROP_ACKProprietary tone, positive acknowlegement: 1200Hz, 100ms ON, 100ms OFF 2 bursts | public static final int | TONE_PROP_NACKProprietary tone, negative acknowlegement: 300Hz+400Hz+500Hz, 400ms ON | public static final int | TONE_PROP_PROMPTProprietary tone, prompt tone: 400Hz+1200Hz, 200ms ON | public static final int | TONE_PROP_BEEP2Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON | public static final int | MAX_VOLUMEMaximum volume, for use with {@link #ToneGenerator(int,int)} | public static final int | MIN_VOLUMEMinimum volume setting, for use with {@link #ToneGenerator(int,int)} | private int | mNativeContext |
Constructors Summary |
---|
public ToneGenerator(int streamType, int volume)ToneGenerator class contructor specifying output stream type and volume.
native_setup(streamType, volume);
|
Methods Summary |
---|
protected void | finalize() native_finalize();
| private final native void | native_finalize()
| private final native void | native_setup(int streamType, int volume)
| public native void | release()Releases resources associated with this ToneGenerator object. It is good
practice to call this method when you're done using the ToneGenerator.
| public native boolean | startTone(int toneType)This method starts the playback of a tone of the specified type.
only one tone can play at a time: if a tone is playing while this method is called,
this tone is stopped and replaced by the one requested.
| public native void | stopTone()This method stops the tone currently playing playback.
|
|