![Symbian OS Library](../../../../a_stock/mainheading.gif)
![]() |
![]() |
|
Location:
MdaAudioSampleEditor.h
Link against: mediaclientaudio.lib
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
- This class is used by both the audio recorder and audio converter
CMdaAudioConvertUtility
- Converts the type, sample rate and format of audio data
Defined in CMdaAudioConvertUtility
:
ClearPlayWindow()
, Close()
, ControllerImplementationInformationL()
, ConvertL()
, CropFromBeginningL()
, CropL()
, CustomCommandAsync()
, CustomCommandAsync()
, CustomCommandSync()
, CustomCommandSync()
, DestinationBitRateL()
, DestinationDataTypeL()
, DestinationFormatL()
, DestinationNumberOfChannelsL()
, DestinationSampleRateL()
, Duration()
, GetSupportedConversionBitRatesL()
, GetSupportedConversionNumberOfChannelsL()
, GetSupportedConversionSampleRatesL()
, GetSupportedDestinationDataTypesL()
, NewL()
, OpenL()
, OpenL()
, OpenL()
, OpenL()
, PlayL()
, Position()
, RecordL()
, RecordTimeAvailable()
, SetDestinationBitRateL()
, SetDestinationDataTypeL()
, SetDestinationFormatL()
, SetDestinationNumberOfChannelsL()
, SetDestinationSampleRateL()
, SetMaxWriteLength()
, SetPlayWindow()
, SetPosition()
, SetRepeats()
, SetThreadPriority()
, SourceBitRateL()
, SourceDataTypeL()
, SourceFormatL()
, SourceNumberOfChannelsL()
, SourceSampleRateL()
, State()
, Stop()
, UseSharedHeap()
, ~CMdaAudioConvertUtility()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Inherited from CMdaAudioClipUtility
:
ENotReady
,
EOpen
,
EPlaying
,
ERecording
,
TState
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. |
static IMPORT_C 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()
. 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()
. The callback is initiated by this function providing it with state change information and error codes.
|
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()
. 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 GetSupportedConversionBitRatesL()
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 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.
|
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 GetSupportedConversionNumberOfChannelsL()
.
|
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()
. 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 ConvertL()
. ConvertL()
should be used instead.
virtual void RecordL();
This function is mapped to ConvertL. 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()
. 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 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 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 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.
|
|
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.
|
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.