Audio convert utility is used to convert audio clips contained in files or descriptors to other formats using the default codecs provided by MMF. This functionality is implemented by the
Using a audio converter utility involves the following tasks:
Construct and open converter utility object
The MMF provides a utility class called
An object of the class, which inherits the
Client's relative priority, which can be
An object of
The following code shows how the client application
Once the audio converter utility object is constructed, you can open an audio clip for conversion using the function
To open an existing audio file and append the converted audio data to another file, use the following version:
Where,
To open existing audio file and store the converted audio data to either a file or a descriptor, use the following version:
Where,
To open audio data either from a file or a descriptor source and store the resulting data to either a file or descriptor, use the following version:
Where,
Note: It is recommended to use the first version of
The following code uses the first version of OpenL to specify source and destination audio location:
Once the converter calls the
Configure conversion parameters
The configuration parameters can be broadly classified into four categories as shown below:
Set recorded file length
You can control the size settings of a recorded file. This is handled by the
The following code sets the maximum number of bytes to 800:
Formats and Codecs
You can report and set formats and codecs for audio data that is already open. The four methods related to DataTypes (codecs) enable you to retrieve a list of supported codecs for the current data format, set a new codec to use or determine which codec is currently in use. A further three methods are provided to query and set the audio format to use.
Codec related actions:
To get the data type of the destination audio clip, use the
To set the data type of the destination audio clip, use the
To get a list of supported data types for the conversion destination, use the
To get the data type of the source audio clip, use the
Data format related actions:
To get the format of the destination audio clip, use the
To set the format of the destination audio clip, use the
To get the format of the source audio clip, use the
Note: It is only possible to report the format and codec used by the source audio and cannot be changed.
Bit and sample rates
You can report and set bit and sample rates as required by specific codecs.
Methods to control the bit rate of audio data:
To get a list of supported bit rates to the conversion destination, use the
To get the bit rate of the destination audio clip, use the
To set the bit rate of the destination audio clip, use the
To get the bit rate of the source audio clip, use the
Note: None of the default codecs provided in the MMF support the use of bit rates. These methods are provided to enable the creation of additional codecs that might require bit rate information, such as the audio format MP3.
Methods for controlling the sampling rate of audio data:
To get a list of supported conversion sample rates, use the
To get the sample rate of the conversion destination, use the
To set the sample rate for the conversion destination, use the
To get the sample rate of the source audio clip, use the
Note: It is only possible to report the bit rate or sample rate used by the source audio and cannot be changed.
Balance
You can report and set the audio mode (mono or stereo).
To get a list of the supported number of channels for conversion, use the
To get the number of channels the destination audio clip contains, use the
To set the number of channels the destination audio clip contains, use the
To get the number of channels used by the conversion source, use the
Note: It is only possible to report the number of supported channels for the source audio and cannot be changed.
Convert audio clip
Several methods are provided in
To start converting audio data from the current position within the audio source and writing the converted data to a play window within the destination file, use the
To stop audio conversion, use the
To stop audio conversion and close all related controllers, use the
Change conversion position and crop audio data
It is possible to crop the audio clip from the current position to the end of the clip or from the begging to the current position as illustrated below:
To crop the current clip from the current position, use the
To crop the audio clip from the start of the file to the current position, use the
To retrieve the current position of the audio clip or move the position to the desired location use the following functions:
To get the current position in the audio clip, use the
To set the current position in the audio clip, use the
Custom commands
To send a raw custom command synchronously to the controller or to allow data to be returned from the controller, use the
To send a raw custom command asynchronously to the controller or to allows data to be returned from the controller, use the
Audio convert utility is used to convert audio clips contained
+in files or descriptors to other formats using the default codecs
+provided by MMF. This functionality is implemented by the
Using a audio converter utility +involves the following tasks:
Construct and open +converter utility object
The MMF provides a utility class
+called
An object of
+the class, which inherits the
Client's relative
+priority, which can be
An object of
The following code shows how the client application
Once the audio converter utility object is constructed,
+you can open an audio clip for conversion using the function
To open an existing +audio file and append the converted audio data to another file, use +the following version:
Where,
To open existing +audio file and store the converted audio data to either a file or +a descriptor, use the following version:
Where,
To open audio +data either from a file or a descriptor source and store the resulting +data to either a file or descriptor, use the following version:
Where,
Note: It is recommended to use the first version
+of
The following code uses the first version of OpenL to specify +source and destination audio location:
Once the converter calls the
Configure conversion +parameters
The configuration parameters can be broadly +classified into four categories as shown below:
Set recorded file length
You can control the size
+settings of a recorded file. This is handled by the
The following code sets the maximum number of bytes to 800:
Formats and Codecs
You can report and set formats +and codecs for audio data that is already open. The four methods related +to DataTypes (codecs) enable you to retrieve a list of supported codecs +for the current data format, set a new codec to use or determine which +codec is currently in use. A further three methods are provided to +query and set the audio format to use.
Codec related actions:
To get the data
+type of the destination audio clip, use the
To set the data
+type of the destination audio clip, use the
To get a list
+of supported data types for the conversion destination, use the
To get the data
+type of the source audio clip, use the
Data format related actions:
To get the format
+of the destination audio clip, use the
To set the format
+of the destination audio clip, use the
To get the format
+of the source audio clip, use the
Note: It is only possible to report the format and +codec used by the source audio and cannot be changed.
Bit and sample rates
You can report and set bit and +sample rates as required by specific codecs.
Methods to control +the bit rate of audio data:
To get a list
+of supported bit rates to the conversion destination, use the
To get the bit
+rate of the destination audio clip, use the
To set the bit
+rate of the destination audio clip, use the
To get the bit
+rate of the source audio clip, use the
Note: None of the default codecs provided in the +MMF support the use of bit rates. These methods are provided to enable +the creation of additional codecs that might require bit rate information, +such as the audio format MP3.
Methods for controlling the +sampling rate of audio data:
To get a list
+of supported conversion sample rates, use the
To get the sample
+rate of the conversion destination, use the
To set the sample
+rate for the conversion destination, use the
To get the sample
+rate of the source audio clip, use the
Note: It is only possible to report the bit rate +or sample rate used by the source audio and cannot be changed.
Balance
You can report and set the audio mode (mono +or stereo).
To get a list
+of the supported number of channels for conversion, use the
To get the number
+of channels the destination audio clip contains, use the
To set the number
+of channels the destination audio clip contains, use the
To get the number
+of channels used by the conversion source, use the
Note: It is only possible to report the number of +supported channels for the source audio and cannot be changed.
Convert audio clip
Several methods are provided in
To start converting
+audio data from the current position within the audio source and writing
+the converted data to a play window within the destination file, use
+the
To stop audio
+conversion, use the
To stop audio
+conversion and close all related controllers, use the
Change conversion +position and crop audio data
It is possible to crop the +audio clip from the current position to the end of the clip or from +the begging to the current position as illustrated below:
To crop the
+current clip from the current position, use the
To crop the
+audio clip from the start of the file to the current position, use
+the
To retrieve the current position of the audio clip or move +the position to the desired location use the following functions:
To get the current
+position in the audio clip, use the
To set the current
+position in the audio clip, use the
Custom commands
To send a raw
+custom command synchronously to the controller or to allow data to
+be returned from the controller, use the
To send a raw
+custom command asynchronously to the controller or to allows data
+to be returned from the controller, use the