Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



How to play a DTMF tone

To play a Dual-Tone Multi-Frequency (DTMF) tone do the following:


Constructing and initializing

Use the CMMFDevSound::NewL() method to construct a new instance of DevSound.

After construction, use an CMMFDevSound::InitializeL() method to initialize DevSound to play tones. This method requires that you specify the DevSound observer class to handle callbacks.

Once initialization has completed, successfully or otherwise, DevSound calls the MDevSoundObserver::InitializeComplete() function.

[Top]


Configuring

The following settings can be configured before or during DTMF tone play:

[Top]


Playing

To start playing a DTMF tone, use the CMMFDevSound::PlayDTMFStringL() method:

IMPORT_C void PlayDTMFStringL(const TDesC &aDTMFString);

CMMFDevSound::PlayDTMFStringL() has one parameter, &aDTMFString, the DTMF sequence in a descriptor.

If CMMFDevSound::SetDTMFLengths() is called during play, it takes effect when the next tone is generated.

When an attempt to play DTMF tones has completed, successfully or otherwise, DevSound calls the MDevSoundObserver::ToneFinished() function.

Note: Further calls to CMMFDevSound::PlayDTMFStringL() can be made both before and after the MDevSoundObserver::ToneFinished() callback is received.