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.
Inherited Enumerations | |
---|---|
CMdaAudioClipUtility:TState |
Private Attributes | |
---|---|
CMMFMdaAudioConvertUtility * | iProperties |
~CMdaAudioConvertUtility | ( | ) | [virtual] |
Destructor.
Closes the audio clip and frees resources.
void | ClearPlayWindow | ( | ) | [virtual] |
Clears the playback window.
Playback returns to playing the entire clip. A subsequent call to ConvertL() results in the entire source audio being converted.
IMPORT_C const CMMFControllerImplementationInformation & | ControllerImplementationInformationL | ( | ) |
Returns the controller implementation information associated with the current controller.
IMPORT_C void | ConvertL | ( | ) |
Performs the conversion from the source audio format to the destination.
When conversion is complete, successfully or otherwise, the client is notified by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() . The callback is initiated by this function providing it with state change information and error codes.
void | CropFromBeginningL | ( | ) | [virtual] |
Crops the audio clip from the start of the file to the current position. The audio data prior to the current position is discarded.
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.
void | CropL | ( | ) | [virtual] |
Crops the current clip from the current position. The remainder of the clip is discarded.
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.
IMPORT_C void | CustomCommandAsync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
const TDesC8 & | aDataTo1, | |||
const TDesC8 & | aDataTo2, | |||
TDes8 & | aDataFrom, | |||
TRequestStatus & | aStatus | |||
) |
Send a asynchronous custom command to the controller.
Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.
const TMMFMessageDestinationPckg & aDestination | The destination of the message, consisting of the UID of the interface of this message. |
TInt aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
const TDesC8 & aDataTo1 | A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8. |
const TDesC8 & aDataTo2 | A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8. |
TDes8 & aDataFrom | A reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8. |
TRequestStatus & aStatus | The TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface. |
IMPORT_C void | CustomCommandAsync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
const TDesC8 & | aDataTo1, | |||
const TDesC8 & | aDataTo2, | |||
TRequestStatus & | aStatus | |||
) |
Send a asynchronous custom command to the controller.
Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.
const TMMFMessageDestinationPckg & aDestination | The destination of the message, consisting of the UID of the interface of this message. |
TInt aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
const TDesC8 & aDataTo1 | A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8. |
const TDesC8 & aDataTo2 | A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8. |
TRequestStatus & aStatus | The TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface. |
IMPORT_C TInt | CustomCommandSync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
const TDesC8 & | aDataTo1, | |||
const TDesC8 & | aDataTo2, | |||
TDes8 & | aDataFrom | |||
) |
Sends a synchronous custom command to the controller.
const TMMFMessageDestinationPckg & aDestination | The destination of the message, consisting of the UID of the interface of this message. |
TInt aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
const TDesC8 & aDataTo1 | A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8. |
const TDesC8 & aDataTo2 | A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8. |
TDes8 & aDataFrom | A reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8. |
IMPORT_C TInt | CustomCommandSync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
const TDesC8 & | aDataTo1, | |||
const TDesC8 & | aDataTo2 | |||
) |
Sends a synchronous custom command to the controller.
const TMMFMessageDestinationPckg & aDestination | The destination of the message, consisting of the UID of the interface of this message. |
TInt aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
const TDesC8 & aDataTo1 | A reference to the first chunk of data to be copied to the controllert framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8. |
const TDesC8 & aDataTo2 | A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8. |
IMPORT_C TUint | DestinationBitRateL | ( | ) |
Returns the bit rate of the destination audio clip.
IMPORT_C TFourCC | DestinationDataTypeL | ( | ) |
Returns the data type of the destination audio clip.
IMPORT_C TUid | DestinationFormatL | ( | ) |
Returns the format of the destination audio clip.
IMPORT_C TUint | DestinationNumberOfChannelsL | ( | ) |
Returns the number of channels the destination audio clip contains.
IMPORT_C TUint | DestinationSampleRateL | ( | ) |
Returns the sample rate of the conversion destination.
const TTimeIntervalMicroSeconds & | Duration | ( | ) | [virtual] |
Returns the duration of the audio clip.
IMPORT_C void | GetSupportedConversionBitRatesL | ( | RArray < TUint > & | aSupportedBitRates | ) |
Gets a list of the supported bit rates for the conversion destination.
IMPORT_C void | GetSupportedConversionNumberOfChannelsL | ( | RArray < TUint > & | aSupportedNumChannels | ) |
Returns a list of the supported number of channels for conversion.
For example, 1 for mono, 2 for stereo and so on.
IMPORT_C void | GetSupportedConversionSampleRatesL | ( | RArray < TUint > & | aSupportedSampleRates | ) |
Gets a list of supported conversion sample rates. This is a list of the sample rates that the conversion destination can take.
IMPORT_C void | GetSupportedDestinationDataTypesL | ( | RArray < TFourCC > & | aSupportedDestinationDataTypes | ) |
Returns a list of the supported data types for the conversion destination.
IMPORT_C CMdaAudioConvertUtility * | NewL | ( | MMdaObjectStateChangeObserver & | aObserver, |
CMdaServer * | aServer = NULL, | |||
TInt | aPriority = EMdaPriorityNormal, | |||
TInt | aPref = EMdaPriorityPreferenceTimeAndQuality | |||
) | [static] |
Constructs and initialises a new instance of the audio converter for converting audio sample data from one format to another.
The function leaves if the audio converter object cannot be created.
MMdaObjectStateChangeObserver & aObserver | The class to receive state change events from converter. |
CMdaServer * aServer = NULL | No longer used, should be NULL. |
TInt aPriority = EMdaPriorityNormal | The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request. |
TInt aPref = EMdaPriorityPreferenceTimeAndQuality | The Priority Preference - an additional audio policy parameter. The suggested default is EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional values may be supported by given phones and/or platforms, but should not be depended upon by portable code. |
void | OpenL | ( | const TDesC & | aPrimaryFile, |
const TDesC & | aSecondaryFile | |||
) | [virtual] |
Opens source and target files (both of which must already exist) so that audio sample data can be extracted from the source file, converted and appended to the target file.
When opening is complete, successfully or otherwise, the client is notified by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() . The callback is initiated by this function providing it with state change information and error codes.
void | OpenL | ( | const TDesC & | aPrimaryFile, |
TMdaClipLocation * | aLocation, | |||
TMdaClipFormat * | aFormat, | |||
TMdaPackage * | aArg1 = NULL, | |||
TMdaPackage * | aArg2 = NULL | |||
) | [virtual] |
Opens an existing audio file so that audio sample data can be extracted from it, converted and placed into the target audio object.
When opening is complete, successfully or otherwise, the client is notified by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() . The callback is initiated by this function providing it with state change information and error codes.
const TDesC & aPrimaryFile | The full path and filename of a file containing audio sample data to be converted. |
TMdaClipLocation * aLocation | The target location for the audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
TMdaClipFormat * aFormat | The audio format for the target audio object. |
TMdaPackage * aArg1 = NULL | The codec to use for the target audio object. |
TMdaPackage * aArg2 = NULL | The audio settings for the target audio object. |
void | OpenL | ( | TMdaClipLocation * | aPriLocation, |
TMdaClipLocation * | aSecLocation, | |||
TMdaClipFormat * | aPriFormat, | |||
TMdaClipFormat * | aSecFormat, | |||
TMdaPackage * | aPriArg1 = NULL, | |||
TMdaPackage * | aPriArg2 = NULL, | |||
TMdaPackage * | aSecArg1 = NULL, | |||
TMdaPackage * | aSecArg2 = NULL | |||
) | [virtual] |
Opens an audio clip for conversion.
TMdaClipLocation * aPriLocation | The source location for audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
TMdaClipLocation * aSecLocation | The target location for audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
TMdaClipFormat * aPriFormat | The audio format of the source audio object. |
TMdaClipFormat * aSecFormat | The audio format for the target audio object. |
TMdaPackage * aPriArg1 = NULL | The codec used by the source audio object. |
TMdaPackage * aPriArg2 = NULL | The audio settings of the source audio object. |
TMdaPackage * aSecArg1 = NULL | The codec to be used for the target audio object. |
TMdaPackage * aSecArg2 = NULL | The audio settings for the target audio object. |
IMPORT_C void | OpenL | ( | TMdaClipLocation * | aPriLocation, |
TMdaClipLocation * | aSecLocation, | |||
TUid | aControllerUid, | |||
TUid | aDestFormatUid, | |||
TFourCC | aDestDataType | |||
) |
Opens source and target audio objects and specifies controller and audio format and codec information.
When opening is complete, successfully or otherwise, the client is notified by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() . The callback is initiated by this function providing it with state change information and error codes.
TMdaClipLocation * aPriLocation | The source location for audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
TMdaClipLocation * aSecLocation | The destination location for the converted audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
TUid aControllerUid | The UID of the controller to used for conversion. |
TUid aDestFormatUid | The UID of the destination format. |
TFourCC aDestDataType | The audio codec to use for the destination data sink. |
void | PlayL | ( | ) | [virtual] |
This function is mapped to ConvertL() . ConvertL() should be used instead.
const TTimeIntervalMicroSeconds & | Position | ( | ) | [virtual] |
Returns the current position in the audio clip. The position is defined in terms of a time interval measured from the beginning of the audio sample data.
void | RecordL | ( | ) | [virtual] |
This function is mapped to ConvertL. ConvertL() should be used instead.
const TTimeIntervalMicroSeconds & | RecordTimeAvailable | ( | ) | [virtual] |
Returns the amount of recording time available to the current clip.
IMPORT_C void | SetDestinationBitRateL | ( | TUint | aBitRate | ) |
Sets the bit rate of the destination audio clip.
The bit rate must be one of the supported bit rates of the audio target. Use GetSupportedConversionBitRatesL() to retrieve a list of supported bit rates.
TUint aBitRate | The destination bit rate in bits/second. |
IMPORT_C void | SetDestinationDataTypeL | ( | TFourCC | aDataType | ) |
Sets the data type of the destination audio clip.
TFourCC aDataType | The four character code, representing the encoding of the destination audio clip |
IMPORT_C void | SetDestinationFormatL | ( | TUid | aFormatUid | ) |
Sets the format of the destination audio clip.
The UID (aFormatUid) corresponds to the UID of the destination format to use.
TUid aFormatUid | The UID of the destination format. |
IMPORT_C void | SetDestinationNumberOfChannelsL | ( | TUint | aNumberOfChannels | ) |
Sets the number of channels the destination audio clip contains.
The number of channels must be one of the values returned by GetSupportedConversionNumberOfChannelsL() .
TUint aNumberOfChannels | The number of channels. |
IMPORT_C void | SetDestinationSampleRateL | ( | TUint | aSampleRate | ) |
Sets the sample rate for the conversion destination.
The sample rate must be one of the supported sample rates of the audio target. Use GetSupportedConversionSampleRatesL() to retrieve a list of supported sample rates. This function should not be used if the audio clip already exists; that is, in the "Open and Append" scenario, when the function's behaviour is undefined.
TUint aSampleRate | The sample rate of the conversion destination in samples per second. |
void | SetMaxWriteLength | ( | TInt | aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone | ) | [virtual] |
Sets the maximum size of an audio clip.
This function is provided so that applications such as recorders and converters can limit the amount of file storage/memory that should be allocated.
TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone | The maximum size of the audio clip, in bytes. If the default value is used, there is no maximum file size. |
void | SetPlayWindow | ( | const TTimeIntervalMicroSeconds & | aStart, |
const TTimeIntervalMicroSeconds & | aEnd | |||
) | [virtual] |
Sets a window for playback.
The window is defined in terms of a start and end time. A subsequent call to ConvertL() results in just the data within the window being converted.
const TTimeIntervalMicroSeconds & aStart | The position in the clip to start playback, in microseconds. This must be any value from zero to aEnd. If this value is less than zero or greater than aEnd, this function raises EMMFMediaClientPanicServerCommunicationProblem panic in debug version. |
const TTimeIntervalMicroSeconds & aEnd | The position in the clip to end playback, in microseconds. This must be any value from aStart to the value returned by Duration(). If this value is greater than the value returned by Duration() or less than aStart, this function raises EMMFMediaClientPanicServerCommunicationProblem panic in debug version. |
void | SetPosition | ( | const TTimeIntervalMicroSeconds & | aPosition | ) | [virtual] |
Sets the current position in the audio clip.
A subsequent call to ConvertL() starts conversion from this new position.
const TTimeIntervalMicroSeconds & aPosition | The position in the audio clip, in microseconds. |
void | SetRepeats | ( | TInt | aRepeatNumberOfTimes, |
const TTimeIntervalMicroSeconds & | aTrailingSilence | |||
) | [virtual] |
Sets the number of repetitions for playback. This is unsupported for CMdaConvertUtility as there is no playback facility. It is provided only for binary compatibility.
TInt aRepeatNumberOfTimes | The number of times to repeat the audio clip, after the first playback. 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 & aTrailingSilence | A delay to wait before each repetition. |
IMPORT_C TInt | SetThreadPriority | ( | const TThreadPriority & | aThreadPriority | ) | const |
Set the priority of the controller's sub thread.
This can be used to increase the responsiveness of the audio plugin to minimise any lag in processing. This function should be used with care as it may have knock-on effects elsewhere in the system.
const TThreadPriority & aThreadPriority |
IMPORT_C TInt | SourceBitRateL | ( | ) |
Returns the bit rate of the source audio clip.
IMPORT_C TFourCC | SourceDataTypeL | ( | ) |
Returns the data type of the source audio clip.
IMPORT_C TUid | SourceFormatL | ( | ) |
Returns the format of the source audio clip.
IMPORT_C TUint | SourceNumberOfChannelsL | ( | ) |
Returns the number of channels used by the conversion source.
IMPORT_C TUint | SourceSampleRateL | ( | ) |
Returns the sample rate of the source audio clip.
void | Stop | ( | ) | [virtual] |
Stops the current operation (playback/recording/conversion).
When conversion has been stopped, successfully or otherwise, the client is notified by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() . The callback is initiated by this function providing it with state change information and error codes.
IMPORT_C void | UseSharedHeap | ( | ) |
Ensures that any subsequent calls to OpenXYZ() will create controllers that share a heap.
The default behaviour is that for each converter utility a controller with its own heap is created. Each heap uses a chunk, so using this function avoids situations where the number of chunks per process is limited. The default behaviour is generally to be preferred, and should give lower overall memory usage. However, if many controllers are to be created for a particular thread, then this function should be used to prevent running out of heaps or chunks.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.