MAudioCodec Class Reference

class MAudioCodec

A generic abstract interface for codecs.

The client must add a codec to a stream for operation. The codec can only be added to a stream when the codec is in uninitialized state. The codec can only be removed from a stream when the codec is in uninitialized or dead states.

Member Functions Documentation

GetSupportedModes(RArray< TUid > &)

TInt GetSupportedModes(RArray< TUid > &aSupportedModes)[pure virtual]

This returns a list of supported sample modes. The list corresponds to the current configuration and support may include the use of mono/stereo conversion etc. GetSupportedModesComplete() callback shows result. TODO Need to document that the implementation is responsible for calling Reset() on aSupportedModes.

Parameters

RArray< TUid > & aSupportedModesarray that is populated with the supported modes list.

GetSupportedSamplesRates(RArray< TInt > &)

TInt GetSupportedSamplesRates(RArray< TInt > &aSupportedRates)[pure virtual]

This returns a list of supported sample rates. The list need just include those of the standard list that are supported. Includes rates supported by sample rate conversion. GetSupportedSampleRatesComplete() callback shows result. TODO Need to document that the implementation is responsible for calling Reset() on aSupportedRates.

Parameters

RArray< TInt > & aSupportedRatesarray that is populated with the supported rates list.

RegisterAudioCodecObserver(MAudioCodecObserver &)

TInt RegisterAudioCodecObserver(MAudioCodecObserver &aObserver)[pure virtual]

Registers an audio codec observer.

Note that this function is meant for clients of the Audio codec. The client should unregister using UnregisterAudioCodecObserver() when applicable

Parameters

MAudioCodecObserver & aObserverreference to the observer to register.

SetFormat(TUid)

TInt SetFormat(TUidaFormat)[pure virtual]

Sets the codec format.

For encoders this sets the output format. For decoders this configures the input format. Format must be set before the codec can transfer to initialized state.

Parameters

TUid aFormatcodec format.

SetMode(TUid)

TInt SetMode(TUidaMode)[pure virtual]

Sets the mode, e.g. mono/stereo. The result of the operation is returned by MAudioCodecObserver::ModeSet().

Parameters

TUid aModeuid stating the mode.

SetSampleRate(TInt)

TInt SetSampleRate(TIntaSampleRate)[pure virtual]

Sets the sample rate in samples/sec.

sets the sample rate of the encoded data, and says nothing about the sample rate used on the output device or whether re-sampling is required that is up to the adaptation. the result of the operation is returned by MAudioCodecObserver::SampleRateSet().

Parameters

TInt aSampleRatesample rate to be used, in samples/sec.

UnregisterAudioCodecObserver(MAudioCodecObserver &)

voidUnregisterAudioCodecObserver(MAudioCodecObserver &aObserver)[pure virtual]

Unregisters an audio codec observer.

Parameters

MAudioCodecObserver & aObserverreference to the observer to unregister.