CDevTTSAudio Class Reference

class CDevTTSAudio : public CBase

Audio playback functionality for DevTTS.

Inherits from

Constructor & Destructor Documentation

CDevTTSAudio(MDevTTSAudioObserver &, TInt)

CDevTTSAudio ( MDevTTSAudioObserver & aObserver,
TInt aPriority
) [private]

C++ default constructor.

Parameters

MDevTTSAudioObserver & aObserver
TInt aPriority

~CDevTTSAudio()

~CDevTTSAudio ( ) [virtual]

Destructor.

Member Functions Documentation

Balance()

TInt Balance ( )

Returns the current balance setting.

BufferToBeEmptied(CMMFBuffer *)

void BufferToBeEmptied ( CMMFBuffer * aBuffer )

From MDevSoundObserver::BufferToBeEmptied Handles CMMFDevSound object's data request event. Called when the buffer, aBuffer gets filled while recording or converting. The observer should notify CMMFDevSound object as quickly as possible after data in the buffer is processed by calling RecordData(), otherwise the implementation might callback method RecordError() on derived class object with error code KErrOverflow.

Parameters

CMMFBuffer * aBuffer

BufferToBeFilled(CMMFBuffer *)

void BufferToBeFilled ( CMMFBuffer * aBuffer )

From MDevSoundObserver::BufferToBeFilled Handles CMMFDevSound object's data request event. CMMFDevSound object calls this method when and where it needs data for playing or converting. The observer should notify CMMFDevSound object as quickly as possible after the data is read into buffer, aBuffer by calling PlayData() , otherwise the implementation might callback method PlayError() on derived class object with error code KErrUnderflow.

Parameters

CMMFBuffer * aBuffer

Clear()

void Clear ( )

Clears the audio device resources. Counter part of InitializeL.

ConfigL(TUint, TUint, TBool, TUint)

void ConfigL ( TUint aSamplingRate,
TUint aBitsPerSample,
TBool aStereo,
TUint aBufferSize
)

Configures the audio device. Method is synchronous.

Parameters

TUint aSamplingRate
TUint aBitsPerSample
TBool aStereo
TUint aBufferSize

ConstructL()

void ConstructL ( ) [private]

By default Symbian 2nd phase constructor is private.

ConvertError(TInt)

void ConvertError ( TInt aError )

From MDevSoundObserver::ConvertError Handles conversion completion or cancel event. Called when an attempt to convert data from source format to destination format has completed, successfully or otherwise.

Parameters

TInt aError

DeviceMessage(TUid, const TDesC8 &)

void DeviceMessage ( TUid aMessageType,
const TDesC8 & aMsg
)

From MDevSoundObserver::DeviceMessage Handles device event. Called when a message is received from the audio hardware device.

Parameters

TUid aMessageType Defines the type of message. Used to determine how to interpret the contents of aMsg.
const TDesC8 & aMsg Message that is packed in the Descriptor format.

InitializeComplete(TInt)

void InitializeComplete ( TInt aError )

From MDevSoundObserver::InitializeComplete Handles initialization completion event from DevSound. Called InitializeL() function completes.

Parameters

TInt aError

InitializeL()

void InitializeL ( )

Initializes the audio device. Method is asynchronous. MDevTTSAudioObserver::InitializeComplete() called when initialization is ready.

MaxVolume()

TInt MaxVolume ( )

Returns maximum volume.

NewL(MDevTTSAudioObserver &, TInt)

CDevTTSAudio * NewL ( MDevTTSAudioObserver & aObserver,
TInt aPriority
) [static]

Two-phased constructor.

Parameters

MDevTTSAudioObserver & aObserver
TInt aPriority

Pause()

void Pause ( )

Pauses the ongoing playback operation

PlayData(TBool)

void PlayData ( TBool aLastBuffer )

Plays the filled buffer, Should be called when BufferToBeFilled callback has filled the requested buffer.

Parameters

TBool aLastBuffer

PlayError(TInt)

void PlayError ( TInt aError )

From MDevSoundObserver::PlayError Handles play completion or cancel event. Called when an attempt to play audio sample has completed, successfully or otherwise.

Parameters

TInt aError

PlayInitL()

void PlayInitL ( )

Initialises the audio playback process.

RecordError(TInt)

void RecordError ( TInt aError )

From MDevSoundObserver::RecordError Handles record completion or cancel event. Called when an attempt to record audio sample has completed, successfully or otherwise.

Parameters

TInt aError

SendEventToClient(const TMMFEvent &)

void SendEventToClient ( const TMMFEvent & aEvent )

From MDevSoundObserver::SendEventToClient Handles policy request completion event. Called when an attempt to acquire sound device is rejected by audio policy server.

Parameters

const TMMFEvent & aEvent

SetAudioOutputL(TInt)

void SetAudioOutputL ( TInt aAudioOutput )

Sets the audio output routing

Parameters

TInt aAudioOutput

SetAudioPriority(TInt, TDevTTSAudioPreference)

void SetAudioPriority ( TInt aPriority,
TDevTTSAudioPreference aPref
)

Sets the priority for audio playback.

Parameters

TInt aPriority
TDevTTSAudioPreference aPref

SetBalance(TInt)

void SetBalance ( TInt aVolume )

Sets the playback balance.

Parameters

TInt aVolume

SetVolume(TInt)

void SetVolume ( TInt aVolume )

Sets the playback volume. Range is from 0 (minumum) to MaxVolume() . Out of range values will be discarded.

Parameters

TInt aVolume

SetVolumeRamp(const TTimeIntervalMicroSeconds &)

void SetVolumeRamp ( const TTimeIntervalMicroSeconds & aRampDuration )

Sets the volume ramp duration

Parameters

const TTimeIntervalMicroSeconds & aRampDuration

Stop()

void Stop ( )

Stops the ongoing playback operation.

ToneFinished(TInt)

void ToneFinished ( TInt aError )

From MDevSoundObserver::ToneFinished Handles tone play completion event. Called when an attempt to play tone has completed, successfully or otherwise.

Parameters

TInt aError

Volume()

TInt Volume ( )

Returns the current volume setting.

Member Data Documentation

CAudioOutput * iAudioOutput

CAudioOutput * iAudioOutput [private]

TMMFPrioritySettings iAudioPriority

TMMFPrioritySettings iAudioPriority [private]

TInt iBalance

TInt iBalance [private]

CMMFBuffer * iBuffer

CMMFBuffer * iBuffer [private]

TMMFCapabilities iDevCap

TMMFCapabilities iDevCap [private]

CMMFDevSound * iDevsound

CMMFDevSound * iDevsound [private]

MDevTTSAudioObserver & iObserver

MDevTTSAudioObserver & iObserver [private]

TInt iPriority

TInt iPriority [private]

TInt iVolume

TInt iVolume [private]