Playing a Fixed Tone Sequence

This tutorial introduces you to play in sequence a fixed tone.

You have to configure DevSound in order to play a Fixed Tone Sequence.

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

  • To return the number of available predefined tone sequences, use the CMMFDevSound::FixedSequenceCount() method:

             IMPORT_C TInt FixedSequenceCount();

    This is the number of fixed sequences supported by DevSound by default.

  • To return the name assigned to a specific predefined tone sequence, use the CMMFDevSound::FixedSequenceName() method:

             IMPORT_C const TDesC &FixedSequenceName(TInt aSequenceNumber);

    This method has one parameter, aSequenceNumber , the index identifying the specific predefined tone sequence and returns a reference to a descriptor containing the fixed sequence name indexed by aSequenceNumber .

  • To change the volume of the audio device to a specific value, use the CMMFDevSound::SetVolume() function. The volume can be set to any value from 0 to CMMFDevSound::MaxVolume() .

    To define a period over which the volume rises from 0 to the normal volume level, use the CMMFDevSound::SetVolumeRamp() function.

    Note: The CMMFDevSound::SetVolumeRamp() function is only available during tone play.

  • To set the speaker balance, use the CMMFDevSound::SetPlayBalanceL() function. This function has two parameters:

    • aLeftPercentage - the left speaker volume percentage.

    • aRightPercentage - the right speaker volume percentage.

  • To set the priority setting for this instance of DevSound to access the audio device, use the CMMFDevSound::SetPrioritySettings() method. Priority settings are used by the Audio Policy component to resolve multiple requests to access the audio hardware.

  • Call the CMMFDevSound::PlayFixedSequenceL(TInt) function to start playing a fixed tone sequence. This function has one parameter, aSequenceNumber , the index identifying the specific predefined tone sequence to be played.

  • Call MDevSoundObserver::ToneFinished(TInt) function to complete successfully a fixed tone sequence. Note: Further calls to CMMFDevSound::PlayFixedSequenceL(TInt) can be made both before and after the MDevSoundObserver::ToneFinished(TInt) callback is received.