CDevTTSAudio Class Reference

class CDevTTSAudio : public CBase

Audio playback functionality for DevTTS.

Inherits from

Constructor & Destructor Documentation

CDevTTSAudio(MDevTTSAudioObserver &, TInt)

CDevTTSAudio(MDevTTSAudioObserver &aObserver,
TIntaPriority
)[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 *)

voidBufferToBeEmptied(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 *)

voidBufferToBeFilled(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()

voidClear()

Clears the audio device resources. Counter part of InitializeL.

ConfigL(TUint, TUint, TBool, TUint)

voidConfigL(TUintaSamplingRate,
TUintaBitsPerSample,
TBoolaStereo,
TUintaBufferSize
)

Configures the audio device. Method is synchronous.

Parameters

TUint aSamplingRate
TUint aBitsPerSample
TBool aStereo
TUint aBufferSize

ConstructL()

voidConstructL()[private]

By default Symbian 2nd phase constructor is private.

ConvertError(TInt)

voidConvertError(TIntaError)

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 &)

voidDeviceMessage(TUidaMessageType,
const TDesC8 &aMsg
)

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

Parameters

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

InitializeComplete(TInt)

voidInitializeComplete(TIntaError)

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

Parameters

TInt aError

InitializeL()

voidInitializeL()

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,
TIntaPriority
)[static]

Two-phased constructor.

Parameters

MDevTTSAudioObserver & aObserver
TInt aPriority

Pause()

voidPause()

Pauses the ongoing playback operation

PlayData(TBool)

voidPlayData(TBoolaLastBuffer)

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

Parameters

TBool aLastBuffer

PlayError(TInt)

voidPlayError(TIntaError)

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()

voidPlayInitL()

Initialises the audio playback process.

RecordError(TInt)

voidRecordError(TIntaError)

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 &)

voidSendEventToClient(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)

voidSetAudioOutputL(TIntaAudioOutput)

Sets the audio output routing

Parameters

TInt aAudioOutput

SetAudioPriority(TInt, TDevTTSAudioPreference)

voidSetAudioPriority(TIntaPriority,
TDevTTSAudioPreferenceaPref
)

Sets the priority for audio playback.

Parameters

TInt aPriority
TDevTTSAudioPreference aPref

SetBalance(TInt)

voidSetBalance(TIntaVolume)

Sets the playback balance.

Parameters

TInt aVolume

SetVolume(TInt)

voidSetVolume(TIntaVolume)

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

Parameters

TInt aVolume

SetVolumeRamp(const TTimeIntervalMicroSeconds &)

voidSetVolumeRamp(const TTimeIntervalMicroSeconds &aRampDuration)

Sets the volume ramp duration

Parameters

const TTimeIntervalMicroSeconds & aRampDuration

Stop()

voidStop()

Stops the ongoing playback operation.

ToneFinished(TInt)

voidToneFinished(TIntaError)

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]