Decodes a frame of audio. @param st Decoder state @param data Compressed data produced by an encoder @param len Number of bytes to read from "data". This MUST be exactly the number of bytes returned by the encoder. Using a larger value WILL NOT WORK. @param pcm One frame (frame_size samples per channel) of decoded PCM will be returned here in 16-bit PCM format (native endian). @return Error code.
Decodes a frame of audio. @param st Decoder state @param data Compressed data produced by an encoder @param len Number of bytes to read from "data". This MUST be exactly the number of bytes returned by the encoder. Using a larger value WILL NOT WORK. @param pcm One frame (frame_size samples per channel) of decoded PCM will be returned here in float format. @return Error code.
Creates a new decoder state. Each stream needs its own decoder state (can't be shared across simultaneous streams). @param mode Contains all the information about the characteristics of the stream (must be the same characteristics as used for the encoder) @param channels Number of channels @param error Returns an error code @return Newly created decoder state.
Query and set decoder parameters @param st Decoder state @param request Parameter to change or query @param value Pointer to a 32-bit int value @return Error code
Destroys a a decoder state. @param st Decoder state to be destroyed
Encodes a frame of audio. @param st Encoder state @param pcm PCM audio in signed 16-bit format (native endian). There must be exactly frame_size samples per channel. @param compressed The compressed data is written here. This may not alias pcm or optional_synthesis. @param nbCompressedBytes Maximum number of bytes to use for compressing the frame (can change from one frame to another) @return Number of bytes written to "compressed". Will be the same as "nbCompressedBytes" unless the stream is VBR and will never be larger. If negative, an error has occurred (see error codes). It is IMPORTANT that the length returned be somehow transmitted to the decoder. Otherwise, no decoding is possible.
Encodes a frame of audio. @param st Encoder state @param pcm PCM audio in float format, with a normal range of ±1.0. Samples with a range beyond ±1.0 are supported but will be clipped by decoders using the integer API and should only be used if it is known that the far end supports extended dynmaic range. There must be exactly frame_size samples per channel. @param compressed The compressed data is written here. This may not alias pcm or optional_synthesis. @param nbCompressedBytes Maximum number of bytes to use for compressing the frame (can change from one frame to another) @return Number of bytes written to "compressed". Will be the same as "nbCompressedBytes" unless the stream is VBR and will never be larger. If negative, an error has occurred (see error codes). It is IMPORTANT that the length returned be somehow transmitted to the decoder. Otherwise, no decoding is possible.
Encodes a frame of audio. @param st Encoder state @param pcm PCM audio in signed 16-bit format (native endian). There must be exactly frame_size samples per channel. @param optional_resynthesis If not NULL, the encoder copies the audio signal that the decoder would decode. It is the same as calling the decoder on the compressed data, just faster. This may alias pcm. @param compressed The compressed data is written here. This may not alias pcm or optional_synthesis. @param nbCompressedBytes Maximum number of bytes to use for compressing the frame (can change from one frame to another) @return Number of bytes written to "compressed". Will be the same as "nbCompressedBytes" unless the stream is VBR and will never be larger. If negative, an error has occurred (see error codes). It is IMPORTANT that the length returned be somehow transmitted to the decoder. Otherwise, no decoding is possible.
Encodes a frame of audio. @param st Encoder state @param pcm PCM audio in float format, with a normal range of ±1.0. Samples with a range beyond ±1.0 are supported but will be clipped by decoders using the integer API and should only be used if it is known that the far end supports extended dynmaic range. There must be exactly frame_size samples per channel. @param optional_resynthesis If not NULL, the encoder copies the audio signal that the decoder would decode. It is the same as calling the decoder on the compressed data, just faster. This may alias pcm. @param compressed The compressed data is written here. This may not alias pcm or optional_synthesis. @param nbCompressedBytes Maximum number of bytes to use for compressing the frame (can change from one frame to another) @return Number of bytes written to "compressed". Will be the same as "nbCompressedBytes" unless the stream is VBR and will never be larger. If negative, an error has occurred (see error codes). It is IMPORTANT that the length returned be somehow transmitted to the decoder. Otherwise, no decoding is possible.
Creates a new encoder state. Each stream needs its own encoder state (can't be shared across simultaneous streams). @param mode Contains all the information about the characteristics of * the stream (must be the same characteristics as used for the * decoder) @param channels Number of channels @param error Returns an error code @return Newly created encoder state.
Query and set encoder parameters @param st Encoder state @param request Parameter to change or query @param value Pointer to a 32-bit int value @return Error code
Destroys a an encoder state. @param st Encoder state to be destroyed
Creates a new mode struct. This will be passed to an encoder or decoder. The mode MUST NOT BE DESTROYED until the encoders and decoders that use it are destroyed as well. @param Fs Sampling rate (32000 to 96000 Hz) @param frame_size Number of samples (per channel) to encode in each packet (even values; 64 - 512) @param error Returned error code (if NULL, no error will be returned) @return A newly created mode
Destroys a mode struct. Only call this after all encoders and decoders using this mode are destroyed as well. @param mode Mode to be destroyed
Query information from a mode
Returns the English string that corresponds to an error code @param error Error code (negative for an error, 0 for success @return Constant string (must NOT be freed)
Memory allocation has failed
An (or more) invalid argument (e.g. out of range)
The data passed (e.g. compressed data to decoder) is corrupted
GET the bit-stream version for compatibility check
GET the lookahead used in the current mode
GET the sample rate used in the current mode
An internal error was detected
The mode struct passed is invalid
An encoder or decoder structure is invalid or already freed
No error
Reset the encoder/decoder memories to zero
Invalid/unsupported request number
Get the CELTMode used by an encoder or decoder
Controls the complexity from 0-10 (int)
Controls the use of interframe prediction. 0=Independent frames 1=Short term interframe prediction allowed 2=Long term prediction allowed
Controls the complexity from 0-10 (int)
Set the target VBR rate in bits per second(int); 0=CBR (default)
@file celt.h @brief Contains all the functions for encoding and decoding audio