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 > & aSupportedModes array 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 > & aSupportedRates array 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 & aObserver reference to the observer to register.

SetFormat(TUid)

TInt SetFormat ( TUid aFormat ) [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 aFormat codec format.

SetMode(TUid)

TInt SetMode ( TUid aMode ) [pure virtual]

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

Parameters

TUid aMode uid stating the mode.

SetSampleRate(TInt)

TInt SetSampleRate ( TInt aSampleRate ) [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 aSampleRate sample rate to be used, in samples/sec.

UnregisterAudioCodecObserver(MAudioCodecObserver &)

void UnregisterAudioCodecObserver ( MAudioCodecObserver & aObserver ) [pure virtual]

Unregisters an audio codec observer.

Parameters

MAudioCodecObserver & aObserver reference to the observer to unregister.