diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-8CCA6352-DC3D-5BFE-9AAF-B70173DF2558.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-8CCA6352-DC3D-5BFE-9AAF-B70173DF2558.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,15 @@ + + + + + +Starting Audio Play This document describes how to play audio using DevSound.
Introduction

To play audio data, you have to do the following:

  • Constructing and initializing

  • Configuring

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 audio. 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.

Configuring

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

  • 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 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.

Procedure
  • To start the play process, use the CMMFDevSound::PlayInitL() method:

    Once started, audio data is played incrementally from a buffer. When there is data in the buffer, use the CMMFDevSound::PlayData() method to play the data.

    When more data is needed for playing, DevSound calls the MDevSoundObserver::BufferToBeFilled() function. When the new data has been read into the buffer, again use the CMMFDevSound::PlayData() method. The client must supply audio data through the buffers at a sufficient rate to avoid buffer underflow.

    Note: The CMMFDevSound::PlayInitL() and CMMFDevSound::PlayData() methods are pseudo-asynchronous. They result in an MDevSoundObserver callback that can occur in context (before the method has returned) or out of context (after the method has returned).

Pausing and + Resuming Playing Stopping Audio + Play Retrieving Audio Play + Samples
\ No newline at end of file