Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Playing audio tones
The CTonePlayer example illustrates how to play tones on Symbian devices. This example plays a simple constant tone for a predefined time, but CMdaAudioToneUtility could also be used to play DTMF (Dual-Tone Multi-Frequency) strings and tone sequences.
To use CMdaAudioToneUtility you need to implement MMdaAudioToneObserver callback interface, which is used by the player to update its status. MMdaAudioToneObserver has two methods defined from which MatoPrepareComplete is called when the tone player is initialized and ready to play. Play function should never be called before MatoPrepareComplete is called. The MatoPlayComplete method is called after the playing of the tone has finalized.
CTonePlayer* self = NewLC();
CTonePlayer* self = new (ELeave) CTonePlayer();
iToneUtility = CMdaAudioToneUtility::NewL(*this);
void CTonePlayer::MatoPrepareComplete(TInt /*aError*/)
void CTonePlayer::MatoPlayComplete(TInt /*aError*/)
class CTonePlayer : public CBase, public MMdaAudioToneObserver
static CTonePlayer* NewL();
static CTonePlayer* NewLC();
protected: // from MMdaAudioToneObserver
void MatoPrepareComplete(TInt aError);
void MatoPlayComplete(TInt aError);