This audio decoder object converts G.723 .1 compressed data to 8 kilohertz 16-bit PCM audio data. The G.723 coder is an ITU Draft Recommendation that is part of the H. 323/ 324 family of standards. The G.723 .1 standard supports two compression rates, 5.3 Kbit per second and 6.3 Kbit per second and is optimized to handle speech signals.
To learn more about the UMSG723Decoder object, see:
For introductory information, see Audio Codec Objects.
The G.723 coder is based on the principles of linear prediction analysis-by-synthesis coding and attempts to minimize a perceptually weighted error signal. The decoder produces frames of 240 samples (30 ms). Each input frame contains either 20 (5.3K data rate) or 24 (6.3K data rate) bytes of compressed data. There is an optional post processing filter step that can be applied to each frame.
There is no information about the encoded data rate in the compressed data stream, and the first important point is to make sure the data rates for the encoder and decoder match. If the data rate is 5.3K, then each compressed frame consists of 20 bytes, and each decompressed frame consists of 240 16-bits samples. If the data rate is 6.3K, then each compressed frame consists of 24 bytes.
For a real-time conferencing application, there may be times when compressed data frames are lost. In this situation, the decoder will still be expecting a new frame every 30 ms. There is the capability, within the G.723 decoder, to synthesis data for a missing frame. The decompress_data method can be called with an empty compressed frame buffer by setting the buffer status set to Empty. Decompressed data will then be generated, using the accumulated frames in the decoder, and this audio data can be played. This will work for up to 2 consecutive frames. After the second frame, the decoder will generate silence if called with an empty frame.
enum ReturnCode { Success, //Command completed successfully Failure, //Execution failure OutOfRange, //Bad input parameter value InsufficientData, //Not enough input data (less than one frame) Uninitialized, //Uninitialized state variable InvalidArgument, //Bad input parameter value ExcessData //Too much input data (more than one frame) };
enum BitRate { Rate53K, //Compressed bit-rate of 5.3 kilobits per second Rate63K //Compressed bit-rate of 6.3 kilobits per second };
enum FilterMode { Filter_On, //Post processing filter ON Filter_Off //Post processing filter OFF };
enum CompDataStatus { FirstBuffer, //The first audio buffer in a sequence NextBuffer, //Compressed audio data EmptyBuffer //No valid compressed data };
Set the compressed bit rate, with 5.3K or 6.3K bits per second.
in BitRate bit_rate | An enum type variable that holds the bit rate setting. |
Query the compressed bit rate setting.
inout BitRate bit_rate | A pointer to an enum type variable that holds the bit rate setting. |
Set the post-processing filter mode to ON or OFF.
in FilterMode mode | A enum type variable that holds the filter mode setting. |
Query the state of the filter setting.
inout FilterMode mode | A pointer to an enum type variable that holds the bit rate setting. |
Query the version of the G.723 decoder object.
out string g723_version | A pointer to a character string holding the version number of the G723 decoder. |
Get the number of number of bytes needed for a input frame of compressed data.
nout long input_size | A pointer to a long variable that holds input frame size (in bytes). |
Query the maximum size needed for the output buffer (in bytes).
inout long buffer_size | A pointer to a long variable that holds the output buffer size. |
This method decompresses a frame of input data into 240 samples of 16 - bit PCM audio data. If a frame of compressed data is lost or corrupted in the audio stream, then there is a procedure in the G.723 decoder that can generate up to two frames out of the decoder's history. This procedure can handle up to two consecutive lost frames. The comp_status variable should be set to EmptyBuffer for any lost or corrupted frames.
For introductory information, see Audio Codec Objects.