|
||
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.
MMMFClientUtility
- No description.
CBase
-
Base class for all classes to be instantiated on the heap.
CMdaAudioClipUtility
- ...
CMdaAudioConvertUtility
-
Converts the type, sample rate and format of audio data.
Defined in CMdaAudioConvertUtility
:
ClearPlayWindow()
Clears the playback window.Close()
Closes the current audio clip.ControllerImplementationInformationL()
Returns the controller implementation information associated with the current co...ConvertL()
Performs the conversion from the source audio format to the destination.CropFromBeginningL()
Crops the audio clip from the start of the file to the current position. The aud...CropL()
Crops the current clip from the current position. The remainder of the clip is d...CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TDes8 &,TRequestStatus &)
Send a asynchronous custom command to the controller.CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TRequestStatus &)
Send a asynchronous custom command to the controller.CustomCommandSync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &)
Sends a synchronous custom command to the controller.CustomCommandSync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TDes8 &)
Sends a synchronous custom command to the controller.DestinationBitRateL()
Returns the bit rate of the destination audio clip.DestinationDataTypeL()
Returns the data type of the destination audio clip.DestinationFormatL()
Returns the format of the destination audio clip.DestinationNumberOfChannelsL()
Returns the number of channels the destination audio clip contains.DestinationSampleRateL()
Returns the sample rate of the conversion destination.Duration()
Returns the duration of the audio clip.GetSupportedConversionBitRatesL(RArray< TUint > &)
Gets a list of the supported bit rates for the conversion destination.GetSupportedConversionNumberOfChannelsL(RArray< TUint > &)
Returns a list of the supported number of channels for conversion.GetSupportedConversionSampleRatesL(RArray< TUint > &)
Gets a list of supported conversion sample rates. This is a list of the sample r...GetSupportedDestinationDataTypesL(RArray< TFourCC > &)
Returns a list of the supported data types for the conversion destination.NewL(MMdaObjectStateChangeObserver &,CMdaServer *,TInt,TMdaPriorityPreference)
Constructs and initialises a new instance of the audio converter for converting ...OpenL(TMdaClipLocation *,TMdaClipLocation *,TMdaClipFormat *,TMdaClipFormat *,TMdaPackage *,TMdaPackage *,TMdaPackage *,TMdaPackage
*)
Opens an audio clip for conversion.OpenL(TMdaClipLocation *,TMdaClipLocation *,TUid,TUid,TFourCC)
Opens source and target audio objects and specifies controller and audio format ...OpenL(const TDesC &,TMdaClipLocation *,TMdaClipFormat *,TMdaPackage *,TMdaPackage *)
Opens an existing audio file so that audio sample data can be extracted from it,...OpenL(const TDesC &,const TDesC &)
Opens source and target files (both of which must already exist) so that audio s...PlayL()
This function is mapped to CMdaAudioConvertUtility::ConvertL(). CMdaAudioConvert...Position()
Returns the current position in the audio clip. The position is defined in terms...RecordL()
This function is mapped to ConvertL. CMdaAudioConvertUtility::ConvertL() should ...RecordTimeAvailable()
Returns the amount of recording time available to the current clip.SetDestinationBitRateL(TUint)
Sets the bit rate of the destination audio clip.SetDestinationDataTypeL(TFourCC)
Sets the data type of the destination audio clip.SetDestinationFormatL(TUid)
Sets the format of the destination audio clip.SetDestinationNumberOfChannelsL(TUint)
Sets the number of channels the destination audio clip contains.SetDestinationSampleRateL(TUint)
Sets the sample rate for the conversion destination.SetMaxWriteLength(TInt)
Sets the maximum size of an audio clip.SetPlayWindow(const TTimeIntervalMicroSeconds &,const TTimeIntervalMicroSeconds &)
Sets a window for playback.SetPosition(const TTimeIntervalMicroSeconds &)
Sets the current position in the audio clip.SetRepeats(TInt,const TTimeIntervalMicroSeconds &)
Sets the number of repetitions for playback. This is unsupported for CMdaConvert...SetThreadPriority(const TThreadPriority &)const
Set the priority of the controller's sub thread.SourceBitRateL()
Returns the bit rate of the source audio clip.SourceDataTypeL()
Returns the data type of the source audio clip.SourceFormatL()
Returns the format of the source audio clip.SourceNumberOfChannelsL()
Returns the number of channels used by the conversion source.SourceSampleRateL()
Returns the sample rate of the source audio clip.State()
Returns the current utility state.Stop()
Stops the current operation (playback/recording/conversion).UseSharedHeap()
Ensures that any subsequent calls to OpenXYZ() will create controllers that shar...~CMdaAudioConvertUtility()
Destructor.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from CMdaAudioClipUtility
:
ENotReady
The audio clip recorder or audio converter has been constructed but no file or d...EOpen
Files or descriptors are open but no playing or recording operation is in progre...EPlaying
Audio sample data is playing.ERecording
New audio sample data is being recorded.TState
Defines the possible state of the audio data sample.Capability: | MultimediaDD | A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that does not have MultimediaDD. |
IMPORT_C static CMdaAudioConvertUtility* NewL(MMdaObjectStateChangeObserver &aObserver, CMdaServer *aServer=0, TInt aPriority=EMdaPriorityNormal,
TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);
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.
|
|
virtual ~CMdaAudioConvertUtility();
Destructor.
Closes the audio clip and frees resources.
virtual void OpenL(const TDesC &aPrimaryFile, const TDesC &aSecondaryFile);
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(CBase *,TInt,TInt,TInt)
. The callback is initiated by this function providing it with state change information and error codes.
|
virtual void OpenL(const TDesC &aPrimaryFile, TMdaClipLocation *aLocation, TMdaClipFormat *aFormat, TMdaPackage *aArg1=0,
TMdaPackage *aArg2=0);
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(CBase *,TInt,TInt,TInt)
. The callback is initiated by this function providing it with state change information and error codes.
|
OpenL(TMdaClipLocation *,TMdaClipLocation *,TMdaClipFormat *,TMdaClipFormat *,TMdaPackage *,TMdaPackage *,TMdaPackage *,TMdaPackage
*)
virtual void OpenL(TMdaClipLocation *aPriLocation, TMdaClipLocation *aSecLocation, TMdaClipFormat *aPriFormat, TMdaClipFormat
*aSecFormat, TMdaPackage *aPriArg1=0, TMdaPackage *aPriArg2=0, TMdaPackage *aSecArg1=0, TMdaPackage *aSecArg2=0);
Opens an audio clip for conversion.
|
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(CBase *,TInt,TInt,TInt)
. The callback is initiated by this function providing it with state change information and error codes.
|
IMPORT_C void GetSupportedDestinationDataTypesL(RArray< TFourCC > &aSupportedDestinationDataTypes);
Returns a list of the supported data types for the conversion destination.
|
IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
Sets the data type of the destination audio clip.
|
IMPORT_C TFourCC DestinationDataTypeL();
Returns the data type of the destination audio clip.
|
IMPORT_C TFourCC SourceDataTypeL();
Returns the data type of the source audio 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 CMdaAudioConvertUtility::GetSupportedConversionBitRatesL(RArray< TUint > &)
to retrieve a list of supported bit rates.
|
IMPORT_C TUint DestinationBitRateL();
Returns the bit rate of the destination audio clip.
|
IMPORT_C void GetSupportedConversionBitRatesL(RArray< TUint > &aSupportedBitRates);
Gets a list of the supported bit rates for the conversion destination.
|
IMPORT_C TInt SourceBitRateL();
Returns the bit rate of the source audio clip.
|
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 CMdaAudioConvertUtility::GetSupportedConversionSampleRatesL(RArray< TUint > &)
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.
|
IMPORT_C TUint DestinationSampleRateL();
Returns the sample rate of the conversion destination.
|
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 TUint SourceSampleRateL();
Returns the sample rate of the source 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.
|
IMPORT_C TUid DestinationFormatL();
Returns the format of the destination audio clip.
|
IMPORT_C TUid SourceFormatL();
Returns the format of the source audio clip.
|
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 CMdaAudioConvertUtility::GetSupportedConversionNumberOfChannelsL(RArray< TUint > &)
.
|
IMPORT_C TUint DestinationNumberOfChannelsL();
Returns the number of channels the destination audio clip contains.
|
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 TUint SourceNumberOfChannelsL();
Returns the number of channels used by the conversion source.
|
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(CBase *,TInt,TInt,TInt)
. The callback is initiated by this function providing it with state change information and error codes.
virtual TState State();
Returns the current utility state.
|
virtual void PlayL();
This function is mapped to CMdaAudioConvertUtility::ConvertL()
. CMdaAudioConvertUtility::ConvertL()
should be used instead.
CMdaAudioConvertUtility::ConvertL()
Performs the conversion from the source audio format to the destination.virtual void RecordL();
This function is mapped to ConvertL. CMdaAudioConvertUtility::ConvertL()
should be used instead.
virtual void Stop();
Stops the current operation (playback/recording/conversion).
When conversion has been stopped, successfully or otherwise, the client is notified by MMdaObjectStateChangeObserver::MoscoStateChangeEvent(CBase *,TInt,TInt,TInt)
. The callback is initiated by this function providing it with state change information and error codes.
virtual void 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.
virtual void SetPosition(const TTimeIntervalMicroSeconds &aPosition);
Sets the current position in the audio clip.
A subsequent call to CMdaAudioConvertUtility::ConvertL()
starts conversion from this new position.
|
virtual const TTimeIntervalMicroSeconds& 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.
|
virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable();
Returns the amount of recording time available to the current clip.
|
virtual const TTimeIntervalMicroSeconds& Duration();
Returns the duration of the audio clip.
|
virtual void SetPlayWindow(const TTimeIntervalMicroSeconds &aStart, const TTimeIntervalMicroSeconds &aEnd);
Sets a window for playback.
The window is defined in terms of a start and end time. A subsequent call to CMdaAudioConvertUtility::ConvertL()
results in just the data within the window being converted.
|
virtual void ClearPlayWindow();
Clears the playback window.
Playback returns to playing the entire clip. A subsequent call to CMdaAudioConvertUtility::ConvertL()
results in the entire source audio being converted.
virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds &aTrailingSilence);
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.
|
virtual void SetMaxWriteLength(TInt aMaxWriteLength=KMdaClipLocationMaxWriteLengthNone);
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.
|
virtual void 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.
IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
Returns the controller implementation information associated with the current controller.
|
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.
|
|
IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const
TDesC8 &aDataTo2);
Sends a synchronous custom command to the controller.
|
|
CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TDes8 &,TRequestStatus &)
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.
|
CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TRequestStatus &)
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.
|
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.
|
|
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.