diff -r 80ef3a206772 -r 48780e181b38 Symbian3/SDK/Source/GUID-ECBA6331-2187-52C9-A5DF-20CD1EEFE781.dita --- a/Symbian3/SDK/Source/GUID-ECBA6331-2187-52C9-A5DF-20CD1EEFE781.dita Fri Jul 16 17:23:46 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-ECBA6331-2187-52C9-A5DF-20CD1EEFE781.dita Tue Jul 20 12:00:49 2010 +0100 @@ -9,7 +9,7 @@ --> -Audio Output Streaming Tutorial

This tutorial describes how to use Audio Output Streaming.

Purpose

The purpose of this tutorial is to show you how to open, play and then close an audio output stream.

Required Background

The user needs to maintain the data packets in a queue before starting to send it to the server. There is no need for the entire sound clip to arrive to be able to pass on to the low level audio controller. They can be forwarded as they arrive. If the server tends to receive data more than it can read or process, then a separate queue is maintained in the client side whose elements are references to the buffers passed to it. Once the server is free to receive more data the client sends the data in the queue and receives a notification from the server by means of a callback. As a result of this, the client deletes the data fragments from the queue.

Upon receiving the data packets the audio controller maintains them in the received buffers. A read function is instantiated to read the data into the destination descriptors.

Introduction

The Audio streaming API is the interface providing the functionalities for playing, stopping, and recording the audio stream to and from the audio buffers. The audio output stream interface class, CMdaAudioOutputStream, enables client applications to:

  • Stream raw audio data from specified buffers to audio devices.

  • Specify the priority of the audio stream relative to other clients trying to use the same hardware.

  • Set the sample rate and the number of audio channels before playback.

  • Adjust the volume and channel balance during playback.

Using Audio Output Streaming

Typically, using an audio output stream involves the following steps as shown in the sequence diagram below:

The following tasks will be covered in this tutorial:

  • Constructing an audio output stream

  • Opening an audio output stream

  • Getting and setting the stream properties

  • Playing an audio output stream

  • Stopping an audio output stream

Basic Procedure for Constructing an Audio Output Stream

The high level step to construct an audio output stream is shown here:

  • The client application creates an audio output stream object using the static function CMdaAudioOutputStream::NewL(). Optionally, it also sets the audio priorities to be able to access the audio hardware in relation to the other clients trying to access the same device.

    static IMPORT_C CMdaAudioOutputStream *NewL(MMdaAudioOutputStreamCallback &aCallBack, +Audio Output Streaming Tutorial

    This tutorial describes how to use Audio Output Streaming.

    Purpose

    The purpose of this tutorial is to show you how to open, play and then close an audio output stream.

    Required Background

    The user needs to maintain the data packets in a queue before starting to send it to the server. There is no need for the entire sound clip to arrive to be able to pass on to the low level audio controller. They can be forwarded as they arrive. If the server tends to receive data more than it can read or process, then a separate queue is maintained in the client side whose elements are references to the buffers passed to it. Once the server is free to receive more data the client sends the data in the queue and receives a notification from the server by means of a callback. As a result of this, the client deletes the data fragments from the queue.

    Upon receiving the data packets the audio controller maintains them in the received buffers. A read function is instantiated to read the data into the destination descriptors.

    Introduction

    The Audio streaming API is the interface providing the functionalities for playing, stopping, and recording the audio stream to and from the audio buffers. The audio output stream interface class, CMdaAudioOutputStream, enables client applications to:

    • Stream raw audio data from specified buffers to audio devices.

    • Specify the priority of the audio stream relative to other clients trying to use the same hardware.

    • Set the sample rate and the number of audio channels before playback.

    • Adjust the volume and channel balance during playback.

    Using Audio Output Streaming

    Typically, using an audio output stream involves the following steps as shown in the sequence diagram below:

    The following tasks will be covered in this tutorial:

    • Constructing an audio output stream

    • Opening an audio output stream

    • Getting and setting the stream properties

    • Playing an audio output stream

    • Stopping an audio output stream

    Basic Procedure for Constructing an Audio Output Stream

    The high level step to construct an audio output stream is shown here:

    • The client application creates an audio output stream object using the static function CMdaAudioOutputStream::NewL(). Optionally, it also sets the audio priorities to be able to access the audio hardware in relation to the other clients trying to access the same device.

      static IMPORT_C CMdaAudioOutputStream *NewL(MMdaAudioOutputStreamCallback &aCallBack, TInt aPriority, TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);

    Basic Procedure for Opening an Audio Output Stream

    The high level steps to open an audio output stream are shown here:

    1. To open the output stream, use the Open() member function. For example:

      virtual void Open(TMdaPackage* aSettings);
    2. Once the stream is open MMdaAudioOutputStreamCallback::MaoscOpenComplete() is invoked to indicate that the stream is ready to use.

      void CIOStreamAudio::MaoscOpenComplete(TInt aError) { ASSERT(iState==EStateOpeningOutput);