#include <mdaaudiosampleeditor.h>
class CMdaAudioConvertUtility : public CMdaAudioClipUtility |
Inherited Enumerations | |
---|---|
CMdaAudioClipUtility:TState |
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.
~CMdaAudioConvertUtility | ( | ) | [virtual] |
Destructor.
Closes the audio clip and frees resources.
void | ClearPlayWindow | ( | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::ClearPlayWindow()
Clears the playback window.
Playback returns to playing the entire clip. A subsequent call to ConvertL() results in the entire source audio being converted.
void | Close | ( | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::Close()
Closes the current audio clip.
IMPORT_C const CMMFControllerImplementationInformation & | ControllerImplementationInformationL | ( | ) |
Returns the controller implementation information associated with the current controller.
Returns: The controller implementation structure associated with the 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] |
Reimplemented from CMdaAudioClipUtility::CropFromBeginningL()
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] |
Reimplemented from CMdaAudioClipUtility::CropL()
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.
Parameter | Description |
---|---|
aDestination | The destination of the message, consisting of the UID of the interface of this message. |
aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
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. |
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. |
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. |
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.
Parameter | Description |
---|---|
aDestination | The destination of the message, consisting of the UID of the interface of this message. |
aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
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. |
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. |
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.
Parameter | Description |
---|---|
aDestination | The destination of the message, consisting of the UID of the interface of this message. |
aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
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. |
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. |
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. |
Returns: The result of the request. Exact range of values is dependent on the interface.
IMPORT_C TInt | CustomCommandSync | ( | const TMMFMessageDestinationPckg & | aDestination, |
TInt | aFunction, | |||
const TDesC8 & | aDataTo1, | |||
const TDesC8 & | aDataTo2 | |||
) |
Sends a synchronous custom command to the controller.
Parameter | Description |
---|---|
aDestination | The destination of the message, consisting of the UID of the interface of this message. |
aFunction | The function number to indicate which function is to be called on the interface defined in the aDestination parameter. |
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. |
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. |
Returns: The result of the request. The exact range of values is dependent on the interface.
IMPORT_C TUint | DestinationBitRateL | ( | ) |
Returns the bit rate of the destination audio clip.
Returns: The destination bit rate in bits/second.
IMPORT_C TFourCC | DestinationDataTypeL | ( | ) |
Returns the data type of the destination audio clip.
Returns: The four character code, representing the encoding of the destination audio clip.
IMPORT_C TUid | DestinationFormatL | ( | ) |
Returns the format of the destination audio clip.
Returns: The UID of the destination format.
IMPORT_C TUint | DestinationNumberOfChannelsL | ( | ) |
Returns the number of channels the destination audio clip contains.
Returns: The number of channels.
IMPORT_C TUint | DestinationSampleRateL | ( | ) |
Returns the sample rate of the conversion destination.
Returns: The sample rate of the conversion destination in samples per second.
const TTimeIntervalMicroSeconds & | Duration | ( | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::Duration()
Returns the duration of the audio clip.
Returns: The duration in microseconds.
Returns a list of the supported number of channels for conversion.
For example, 1 for mono, 2 for stereo and so on.
Parameter | Description |
---|---|
aSupportedNumChannels | A list of the number of channels supported for the conversion destination. |
Gets a list of supported conversion sample rates. This is a list of the sample rates that the conversion destination can take.
Parameter | Description |
---|---|
aSupportedSampleRates | A list of the sample rates that are supported for the conversion. |
Returns a list of the supported data types for the conversion destination.
Parameter | Description |
---|---|
aSupportedDestinationDataTypes | A list of four character codes, representing the supported data encodings 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.
Parameter | Description |
---|---|
aObserver | The class to receive state change events from converter. |
aServer | No longer used, should be NULL. |
aPriority | 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. |
aPref | 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. |
Returns: A pointer to a new instance of CMdaAudioConvertUtility.
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.
Parameter | Description |
---|---|
aPrimaryFile | The full path and filename of a file containing audio sample data to be converted. |
aSecondaryFile | The full path and filename of a file to which converted data is appended. |
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.
Parameter | Description |
---|---|
aPrimaryFile | The full path and filename of a file containing audio sample data to be converted. |
aLocation | The target location for the audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
aFormat | The audio format for the target audio object. |
aArg1 | The codec to use for the target audio object. |
aArg2 | 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.
Parameter | Description |
---|---|
aPriLocation | The source location for audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
aSecLocation | The target location for audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
aPriFormat | The audio format of the source audio object. |
aSecFormat | The audio format for the target audio object. |
aPriArg1 | The codec used by the source audio object. |
aPriArg2 | The audio settings of the source audio object. |
aSecArg1 | The codec to be used for the target audio object. |
aSecArg2 | 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.
Parameter | Description |
---|---|
aPriLocation | The source location for audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
aSecLocation | The destination location for the converted audio data. This is normally a file (TMdaFileClipLocation) or a descriptor (TMdaDesClipLocation). |
aControllerUid | The UID of the controller to used for conversion. |
aDestFormatUid | The UID of the destination format. |
aDestDataType | The audio codec to use for the destination data sink. |
void | PlayL | ( | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::PlayL()
This function is mapped to ConvertL(). ConvertL() should be used instead.
See also: ConvertL()
const TTimeIntervalMicroSeconds & | Position | ( | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::Position()
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.
Returns: The current position in the audio clip, in microseconds.
void | RecordL | ( | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::RecordL()
This function is mapped to ConvertL. ConvertL() should be used instead.
const TTimeIntervalMicroSeconds & | RecordTimeAvailable | ( | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::RecordTimeAvailable()
Returns the amount of recording time available to the current clip.
Returns: The recording time available measured in microseconds.
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.
Parameter | Description |
---|---|
aBitRate | The destination bit rate in bits/second. |
IMPORT_C void | SetDestinationDataTypeL | ( | TFourCC | aDataType | ) |
Sets the data type of the destination audio clip.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
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().
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aSampleRate | The sample rate of the conversion destination in samples per second. |
void | SetMaxWriteLength | ( | TInt | aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::SetMaxWriteLength(TInt)
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.
Parameter | Description |
---|---|
aMaxWriteLength | 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] |
Reimplemented from CMdaAudioClipUtility::SetPlayWindow(const TTimeIntervalMicroSeconds &,const TTimeIntervalMicroSeconds &)
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.
Parameter | Description |
---|---|
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. |
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] |
Reimplemented from CMdaAudioClipUtility::SetPosition(const TTimeIntervalMicroSeconds &)
Sets the current position in the audio clip.
A subsequent call to ConvertL() starts conversion from this new position.
Parameter | Description |
---|---|
aPosition | The position in the audio clip, in microseconds. |
void | SetRepeats | ( | TInt | aRepeatNumberOfTimes, |
const TTimeIntervalMicroSeconds & | aTrailingSilence | |||
) | [virtual] |
Reimplemented from CMdaAudioClipUtility::SetRepeats(TInt,const TTimeIntervalMicroSeconds &)
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.
Parameter | Description |
---|---|
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. |
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.
Returns: TInt A standard error code: KErrNone if successful, KErrNotReady if the thread does not have a valid handle.
IMPORT_C TInt | SourceBitRateL | ( | ) |
Returns the bit rate of the source audio clip.
Returns: The source bit rate in bits/second.
IMPORT_C TFourCC | SourceDataTypeL | ( | ) |
Returns the data type of the source audio clip.
Returns: The four character code, representing the encoding of the source audio clip.
IMPORT_C TUid | SourceFormatL | ( | ) |
Returns the format of the source audio clip.
Returns: The UID of the source format.
IMPORT_C TUint | SourceNumberOfChannelsL | ( | ) |
Returns the number of channels used by the conversion source.
Returns: The number of channels.
IMPORT_C TUint | SourceSampleRateL | ( | ) |
Returns the sample rate of the source audio clip.
Returns: The source sample rate in samples/second.
TState | State | ( | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::State()
Returns the current utility state.
Returns: The state of the audio sample data. See CMdaAudioClipUtility::TState.
void | Stop | ( | ) | [virtual] |
Reimplemented from CMdaAudioClipUtility::Stop()
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.