CMdaAudioConvertUtility Class Reference

class CMdaAudioConvertUtility : public CMdaAudioClipUtility

Converts the type, sample rate and format of audio data.

The audio sample data can be supplied either in a file or as a descriptor.

Inherits from

Public Member Functions
~CMdaAudioConvertUtility()
voidClearPlayWindow()
voidClose()
IMPORT_C const CMMFControllerImplementationInformation &ControllerImplementationInformationL()
IMPORT_C voidConvertL()
voidCropFromBeginningL()
voidCropL()
IMPORT_C voidCustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C voidCustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus &)
IMPORT_C TIntCustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &)
IMPORT_C TIntCustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &)
IMPORT_C TUintDestinationBitRateL()
IMPORT_C TFourCCDestinationDataTypeL()
IMPORT_C TUidDestinationFormatL()
IMPORT_C TUintDestinationNumberOfChannelsL()
IMPORT_C TUintDestinationSampleRateL()
const TTimeIntervalMicroSeconds &Duration()
IMPORT_C voidGetSupportedConversionBitRatesL(RArray< TUint > &)
IMPORT_C voidGetSupportedConversionNumberOfChannelsL(RArray< TUint > &)
IMPORT_C voidGetSupportedConversionSampleRatesL(RArray< TUint > &)
IMPORT_C voidGetSupportedDestinationDataTypesL(RArray< TFourCC > &)
IMPORT_C CMdaAudioConvertUtility *NewL(MMdaObjectStateChangeObserver &, CMdaServer *, TInt, TInt)
voidOpenL(const TDesC &, const TDesC &)
voidOpenL(const TDesC &, TMdaClipLocation *, TMdaClipFormat *, TMdaPackage *, TMdaPackage *)
voidOpenL(TMdaClipLocation *, TMdaClipLocation *, TMdaClipFormat *, TMdaClipFormat *, TMdaPackage *, TMdaPackage *, TMdaPackage *, TMdaPackage *)
IMPORT_C voidOpenL(TMdaClipLocation *, TMdaClipLocation *, TUid, TUid, TFourCC)
voidPlayL()
const TTimeIntervalMicroSeconds &Position()
voidRecordL()
const TTimeIntervalMicroSeconds &RecordTimeAvailable()
IMPORT_C voidSetDestinationBitRateL(TUint)
IMPORT_C voidSetDestinationDataTypeL(TFourCC)
IMPORT_C voidSetDestinationFormatL(TUid)
IMPORT_C voidSetDestinationNumberOfChannelsL(TUint)
IMPORT_C voidSetDestinationSampleRateL(TUint)
voidSetMaxWriteLength(TInt)
voidSetPlayWindow(const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &)
voidSetPosition(const TTimeIntervalMicroSeconds &)
voidSetRepeats(TInt, const TTimeIntervalMicroSeconds &)
IMPORT_C TIntSetThreadPriority(const TThreadPriority &)
IMPORT_C TIntSourceBitRateL()
IMPORT_C TFourCCSourceDataTypeL()
IMPORT_C TUidSourceFormatL()
IMPORT_C TUintSourceNumberOfChannelsL()
IMPORT_C TUintSourceSampleRateL()
TState State()
voidStop()
IMPORT_C voidUseSharedHeap()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CMdaAudioClipUtility::ClipUtil_Reserved3()
CMdaAudioClipUtility::ClipUtil_Reserved4()
CMdaAudioClipUtility::TypeL()
Inherited Enumerations
CMdaAudioClipUtility:TState
Private Attributes
CMMFMdaAudioConvertUtility *iProperties

Constructor & Destructor Documentation

~CMdaAudioConvertUtility()

~CMdaAudioConvertUtility()[virtual]

Member Functions Documentation

ClearPlayWindow()

voidClearPlayWindow()[virtual]

Removes any window defined on the audio sample data.

All subsequent playing, position setting and position querying requests are mapped to the whole of the audio sample data.

5.0

Close()

voidClose()[virtual]

Releases any currently open audio sample data.

5.0

ControllerImplementationInformationL()

IMPORT_C const CMMFControllerImplementationInformation &ControllerImplementationInformationL()

ConvertL()

IMPORT_C voidConvertL()

CropFromBeginningL()

voidCropFromBeginningL()[virtual]

Deletes all audio sample data from the beginning of the audio clip. The effects of the function cannot be undone.

The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.

5.0

CropL()

voidCropL()[virtual]

Deletes all audio sample data after the current head position. The effects of the function cannot be undone.

The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.

5.0

CustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)

IMPORT_C voidCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom,
TRequestStatus &aStatus
)

Parameters

const TMMFMessageDestinationPckg & aDestination
TInt aFunction
const TDesC8 & aDataTo1
const TDesC8 & aDataTo2
TDes8 & aDataFrom
TRequestStatus & aStatus

CustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus &)

IMPORT_C voidCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TRequestStatus &aStatus
)

Parameters

const TMMFMessageDestinationPckg & aDestination
TInt aFunction
const TDesC8 & aDataTo1
const TDesC8 & aDataTo2
TRequestStatus & aStatus

CustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &)

IMPORT_C TIntCustomCommandSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom
)

Parameters

const TMMFMessageDestinationPckg & aDestination
TInt aFunction
const TDesC8 & aDataTo1
const TDesC8 & aDataTo2
TDes8 & aDataFrom

CustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &)

IMPORT_C TIntCustomCommandSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2
)

Parameters

const TMMFMessageDestinationPckg & aDestination
TInt aFunction
const TDesC8 & aDataTo1
const TDesC8 & aDataTo2

DestinationBitRateL()

IMPORT_C TUintDestinationBitRateL()

DestinationDataTypeL()

IMPORT_C TFourCCDestinationDataTypeL()

DestinationFormatL()

IMPORT_C TUidDestinationFormatL()

DestinationNumberOfChannelsL()

IMPORT_C TUintDestinationNumberOfChannelsL()

DestinationSampleRateL()

IMPORT_C TUintDestinationSampleRateL()

Duration()

const TTimeIntervalMicroSeconds &Duration()[virtual]

Returns the duration of the audio sample data.

5.0

GetSupportedConversionBitRatesL(RArray< TUint > &)

IMPORT_C voidGetSupportedConversionBitRatesL(RArray< TUint > &aSupportedBitRates)

Parameters

RArray< TUint > & aSupportedBitRates

GetSupportedConversionNumberOfChannelsL(RArray< TUint > &)

IMPORT_C voidGetSupportedConversionNumberOfChannelsL(RArray< TUint > &aSupportedNumChannels)

Parameters

RArray< TUint > & aSupportedNumChannels

GetSupportedConversionSampleRatesL(RArray< TUint > &)

IMPORT_C voidGetSupportedConversionSampleRatesL(RArray< TUint > &aSupportedSampleRates)

Parameters

RArray< TUint > & aSupportedSampleRates

GetSupportedDestinationDataTypesL(RArray< TFourCC > &)

IMPORT_C voidGetSupportedDestinationDataTypesL(RArray< TFourCC > &aSupportedDestinationDataTypes)

Parameters

RArray< TFourCC > & aSupportedDestinationDataTypes

NewL(MMdaObjectStateChangeObserver &, CMdaServer *, TInt, TInt)

IMPORT_C CMdaAudioConvertUtility *NewL(MMdaObjectStateChangeObserver &aObserver,
CMdaServer *aServer = NULL,
TIntaPriority = EMdaPriorityNormal,
TIntaPref = EMdaPriorityPreferenceTimeAndQuality
)[static]

Parameters

MMdaObjectStateChangeObserver & aObserver
CMdaServer * aServer = NULL
TInt aPriority = EMdaPriorityNormal
TInt aPref = EMdaPriorityPreferenceTimeAndQuality

OpenL(const TDesC &, const TDesC &)

voidOpenL(const TDesC &aPrimaryFile,
const TDesC &aSecondaryFile
)[virtual]

Parameters

const TDesC & aPrimaryFile
const TDesC & aSecondaryFile

OpenL(const TDesC &, TMdaClipLocation *, TMdaClipFormat *, TMdaPackage *, TMdaPackage *)

voidOpenL(const TDesC &aPrimaryFile,
TMdaClipLocation *aLocation,
TMdaClipFormat *aFormat,
TMdaPackage *aArg1 = NULL,
TMdaPackage *aArg2 = NULL
)[virtual]

Parameters

const TDesC & aPrimaryFile
TMdaClipLocation * aLocation
TMdaClipFormat * aFormat
TMdaPackage * aArg1 = NULL
TMdaPackage * aArg2 = NULL

OpenL(TMdaClipLocation *, TMdaClipLocation *, TMdaClipFormat *, TMdaClipFormat *, TMdaPackage *, TMdaPackage *, TMdaPackage *, TMdaPackage *)

voidOpenL(TMdaClipLocation *aPriLocation,
TMdaClipLocation *aSecLocation,
TMdaClipFormat *aPriFormat,
TMdaClipFormat *aSecFormat,
TMdaPackage *aPriArg1 = NULL,
TMdaPackage *aPriArg2 = NULL,
TMdaPackage *aSecArg1 = NULL,
TMdaPackage *aSecArg2 = NULL
)[virtual]

Parameters

TMdaClipLocation * aPriLocation
TMdaClipLocation * aSecLocation
TMdaClipFormat * aPriFormat
TMdaClipFormat * aSecFormat
TMdaPackage * aPriArg1 = NULL
TMdaPackage * aPriArg2 = NULL
TMdaPackage * aSecArg1 = NULL
TMdaPackage * aSecArg2 = NULL

OpenL(TMdaClipLocation *, TMdaClipLocation *, TUid, TUid, TFourCC)

IMPORT_C voidOpenL(TMdaClipLocation *aPriLocation,
TMdaClipLocation *aSecLocation,
TUidaControllerUid,
TUidaDestFormatUid,
TFourCCaDestDataType
)

Parameters

TMdaClipLocation * aPriLocation
TMdaClipLocation * aSecLocation
TUid aControllerUid
TUid aDestFormatUid
TFourCC aDestDataType

PlayL()

voidPlayL()[virtual]

Begins playback of audio sample data at the current playback position using the current volume, gain and priority settings.

5.0

Position()

const TTimeIntervalMicroSeconds &Position()[virtual]

Returns the current head position.

The head position is defined in terms of a time interval measured from the beginning of the audio sample data.

5.0

RecordL()

voidRecordL()[virtual]

Starts appending new audio sample data.

The new audio sample data is appended to the existing audio sample data in the same format as the existing audio sample data. If existing data is to be overwritten, then it should be cropped to the appropriate length before appending the new data.

Note, before starting to record, make sure that the gain is set by calling CMdaAudioRecorderUtility::SetGain(), as the initial gain is undefined. The gain might also have been modified by another client application.

5.0

CMdaAudioRecorderUtility

CMdaAudioRecorderUtility::SetGain()

RecordTimeAvailable()

const TTimeIntervalMicroSeconds &RecordTimeAvailable()[virtual]

Returns the recording time available for the selected file or descriptor and encoding format.

5.0

SetDestinationBitRateL(TUint)

IMPORT_C voidSetDestinationBitRateL(TUintaBitRate)

Parameters

TUint aBitRate

SetDestinationDataTypeL(TFourCC)

IMPORT_C voidSetDestinationDataTypeL(TFourCCaDataType)

Parameters

TFourCC aDataType

SetDestinationFormatL(TUid)

IMPORT_C voidSetDestinationFormatL(TUidaFormatUid)

Parameters

TUid aFormatUid

SetDestinationNumberOfChannelsL(TUint)

IMPORT_C voidSetDestinationNumberOfChannelsL(TUintaNumberOfChannels)

Parameters

TUint aNumberOfChannels

SetDestinationSampleRateL(TUint)

IMPORT_C voidSetDestinationSampleRateL(TUintaSampleRate)

Parameters

TUint aSampleRate

SetMaxWriteLength(TInt)

voidSetMaxWriteLength(TIntaMaxWriteLength =  KMdaClipLocationMaxWriteLengthNone )[virtual]

Sets the maximum size for a file that is being recorded.

When this limit is reached, MMF stops recording and notifies the client application. Notification is caused by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() with the error code KErrEof.

This function is provided so that applications such as recorders can limit the amount of file storage/memory that should be allocated.

5.0

Parameters

TInt aMaxWriteLength =  KMdaClipLocationMaxWriteLengthNone The maximum file size in kilobytes. If the default value is used, there is no maximum file size.

SetPlayWindow(const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &)

voidSetPlayWindow(const TTimeIntervalMicroSeconds &aStart,
const TTimeIntervalMicroSeconds &aEnd
)[virtual]

Defines a window on the audio sample data.

The window is defined in terms of a start and end position. When the current playback position reaches the window end position, or Stop() is called, the current playback position is set to the window start position and playback stops.

The current playback position is not affected by a call to SetPlayWindow() unless it is outside the new playback window, in which case it is set to the window start or end position depending on which one is closer.

The window persists until ClearPlayWindow() is called. Loading new audio sample data without adjusting or clearing the window will result in playback errors if the window is outside the new data.

5.0

Parameters

const TTimeIntervalMicroSeconds & aStartThe position defining the start of the window, measured in microseconds. If this value is less than zero, it is set to zero. If this value is greater than aEnd, then it is swapped with aEnd.
const TTimeIntervalMicroSeconds & aEndThe position defining the end of the window, measured in microseconds. If this value is greater than the value returned by Duration(), it is set to the value of Duration(). If this value is less than aStart, then it is swapped with aStart.

SetPosition(const TTimeIntervalMicroSeconds &)

voidSetPosition(const TTimeIntervalMicroSeconds &aPosition)[virtual]

Sets the head position.

The playback head is moved to a position which is defined in terms of a time interval measured from the beginning of the audio sample data. A subsequent call to PlayL() starts from this new position.

5.0

Parameters

const TTimeIntervalMicroSeconds & aPosition

SetRepeats(TInt, const TTimeIntervalMicroSeconds &)

voidSetRepeats(TIntaRepeatNumberOfTimes,
const TTimeIntervalMicroSeconds &aTrailingSilence
)[virtual]

Sets the number of times the audio sample is to be repeated during the PlayL() operation.

A period of silence can follow each playing of the audio sample. The audio sample can be repeated indefinitely or until stopped.

5.0

Parameters

TInt aRepeatNumberOfTimesThe number of times the audio sample, together with the trailing silence, is to be repeated. If this is set to KMdaRepeatForever, then the audio sample, together with the trailing silence, is repeated indefinitely. If this is set to zero, then the audio sample is not repeated.
const TTimeIntervalMicroSeconds & aTrailingSilenceThe length of the trailing silence in microseconds.

SetThreadPriority(const TThreadPriority &)

IMPORT_C TIntSetThreadPriority(const TThreadPriority &aThreadPriority)const

Parameters

const TThreadPriority & aThreadPriority

SourceBitRateL()

IMPORT_C TIntSourceBitRateL()

SourceDataTypeL()

IMPORT_C TFourCCSourceDataTypeL()

SourceFormatL()

IMPORT_C TUidSourceFormatL()

SourceNumberOfChannelsL()

IMPORT_C TUintSourceNumberOfChannelsL()

SourceSampleRateL()

IMPORT_C TUintSourceSampleRateL()

State()

TState State()[virtual]

Returns the current state of the audio sample data.

The state of the audio sample data.

5.0

Stop()

voidStop()[virtual]

Stops the playback or recording operation.

The operation is stopped at the current location. For a playback operation, the head is positioned at the last played data.

5.0

UseSharedHeap()

IMPORT_C voidUseSharedHeap()

Member Data Documentation

CMMFMdaAudioConvertUtility * iProperties

CMMFMdaAudioConvertUtility *iProperties[private]