This is the Speex codec itself.
More...
|
typedef void *(* | encoder_init_func) (const struct SpeexMode *mode) |
|
typedef void(* | encoder_destroy_func) (void *st) |
|
typedef int(* | encode_func) (void *state, void *in, SpeexBits *bits) |
|
typedef int(* | encoder_ctl_func) (void *state, int request, void *ptr) |
|
typedef void *(* | decoder_init_func) (const struct SpeexMode *mode) |
|
typedef void(* | decoder_destroy_func) (void *st) |
|
typedef int(* | decode_func) (void *state, SpeexBits *bits, void *out) |
|
typedef int(* | decoder_ctl_func) (void *state, int request, void *ptr) |
|
typedef int(* | mode_query_func) (const void *mode, int request, void *ptr) |
|
typedef struct SpeexMode | SpeexMode |
|
|
void * | speex_encoder_init (const SpeexMode *mode) |
|
void | speex_encoder_destroy (void *state) |
|
int | speex_encode (void *state, float *in, SpeexBits *bits) |
|
int | speex_encode_int (void *state, spx_int16_t *in, SpeexBits *bits) |
|
int | speex_encoder_ctl (void *state, int request, void *ptr) |
|
void * | speex_decoder_init (const SpeexMode *mode) |
|
void | speex_decoder_destroy (void *state) |
|
int | speex_decode (void *state, SpeexBits *bits, float *out) |
|
int | speex_decode_int (void *state, SpeexBits *bits, spx_int16_t *out) |
|
int | speex_decoder_ctl (void *state, int request, void *ptr) |
|
int | speex_mode_query (const SpeexMode *mode, int request, void *ptr) |
|
int | speex_lib_ctl (int request, void *ptr) |
|
const SpeexMode * | speex_lib_get_mode (int mode) |
|
This is the Speex codec itself.
◆ SPEEX_GET_ABR
Get Average Bit-Rate (ABR) setting (in bps)
◆ SPEEX_GET_ACTIVITY
#define SPEEX_GET_ACTIVITY 47 |
Get "activity level" of the last decoded frame, i.e. how much damage we cause if we remove the frame
◆ SPEEX_GET_BITRATE
#define SPEEX_GET_BITRATE 19 |
Get current bit-rate used by the encoder or decoder
◆ SPEEX_GET_COMPLEXITY
#define SPEEX_GET_COMPLEXITY 17 |
Get current complexity of the encoder (0-10)
◆ SPEEX_GET_DTX
Get DTX status (1 for on, 0 for off)
◆ SPEEX_GET_ENH
Get enhancement state (decoder only)
◆ SPEEX_GET_FRAME_SIZE
#define SPEEX_GET_FRAME_SIZE 3 |
Obtain frame size used by encoder/decoder
◆ SPEEX_GET_HIGH_MODE
#define SPEEX_GET_HIGH_MODE 11 |
Get current high-band mode in use (wideband only)
◆ SPEEX_GET_HIGHPASS
#define SPEEX_GET_HIGHPASS 45 |
Get status of input/output high-pass filtering
◆ SPEEX_GET_LOOKAHEAD
#define SPEEX_GET_LOOKAHEAD 39 |
Returns the lookahead used by Speex
◆ SPEEX_GET_LOW_MODE
#define SPEEX_GET_LOW_MODE 9 |
Get current low-band mode in use (wideband only)
◆ SPEEX_GET_MODE
Get current sub-mode in use
◆ SPEEX_GET_PF
Equivalent to SPEEX_GET_ENH
◆ SPEEX_GET_PLC_TUNING
#define SPEEX_GET_PLC_TUNING 41 |
◆ SPEEX_GET_RELATIVE_QUALITY
#define SPEEX_GET_RELATIVE_QUALITY 29 |
Get VBR info (mostly used internally)
◆ SPEEX_GET_SAMPLING_RATE
#define SPEEX_GET_SAMPLING_RATE 25 |
Get sampling rate used in bit-rate computation
◆ SPEEX_GET_SUBMODE_ENCODING
#define SPEEX_GET_SUBMODE_ENCODING 37 |
Get submode encoding in each frame
◆ SPEEX_GET_VAD
Get VAD status (1 for on, 0 for off)
◆ SPEEX_GET_VBR
Get VBR status (1 for on, 0 for off)
◆ SPEEX_GET_VBR_MAX_BITRATE
#define SPEEX_GET_VBR_MAX_BITRATE 43 |
Gets the max bit-rate allowed in VBR mode
◆ SPEEX_GET_VBR_QUALITY
#define SPEEX_GET_VBR_QUALITY 15 |
Get current quality value for VBR encoding (0-10)
◆ SPEEX_LIB_GET_EXTRA_VERSION
#define SPEEX_LIB_GET_EXTRA_VERSION 7 |
◆ SPEEX_LIB_GET_MAJOR_VERSION
#define SPEEX_LIB_GET_MAJOR_VERSION 1 |
◆ SPEEX_LIB_GET_MICRO_VERSION
#define SPEEX_LIB_GET_MICRO_VERSION 5 |
◆ SPEEX_LIB_GET_MINOR_VERSION
#define SPEEX_LIB_GET_MINOR_VERSION 3 |
◆ SPEEX_LIB_GET_VERSION_STRING
#define SPEEX_LIB_GET_VERSION_STRING 9 |
◆ SPEEX_MODE_FRAME_SIZE
#define SPEEX_MODE_FRAME_SIZE 0 |
Query the frame size of a mode
◆ SPEEX_MODEID_NB
#define SPEEX_MODEID_NB 0 |
modeID for the defined narrowband mode
◆ SPEEX_MODEID_UWB
#define SPEEX_MODEID_UWB 2 |
modeID for the defined ultra-wideband mode
◆ SPEEX_MODEID_WB
#define SPEEX_MODEID_WB 1 |
modeID for the defined wideband mode
◆ SPEEX_NB_MODES
Number of defined modes in Speex
◆ SPEEX_RESET_STATE
#define SPEEX_RESET_STATE 26 |
Reset the encoder/decoder memories to zero
◆ SPEEX_SET_ABR
Set Average Bit-Rate (ABR) to n bits per seconds
◆ SPEEX_SET_BITRATE
#define SPEEX_SET_BITRATE 18 |
Set bit-rate used by the encoder (or lower)
◆ SPEEX_SET_COMPLEXITY
#define SPEEX_SET_COMPLEXITY 16 |
Set complexity of the encoder (0-10)
◆ SPEEX_SET_DTX
Set DTX status (1 for on, 0 for off)
◆ SPEEX_SET_ENH
Set enhancement on/off (decoder only)
◆ SPEEX_SET_HANDLER
#define SPEEX_SET_HANDLER 20 |
Define a handler function for in-band Speex request
◆ SPEEX_SET_HIGH_MODE
#define SPEEX_SET_HIGH_MODE 10 |
Set high-band sub-mode to use (wideband only)
◆ SPEEX_SET_HIGHPASS
#define SPEEX_SET_HIGHPASS 44 |
Turn on/off input/output high-pass filtering
◆ SPEEX_SET_LOW_MODE
#define SPEEX_SET_LOW_MODE 8 |
Set low-band sub-mode to use (wideband only)
◆ SPEEX_SET_MODE
Get current quality setting Set sub-mode to use
◆ SPEEX_SET_PF
Equivalent to SPEEX_SET_ENH
◆ SPEEX_SET_PLC_TUNING
#define SPEEX_SET_PLC_TUNING 40 |
Sets tuning for packet-loss concealment (expected loss rate)
◆ SPEEX_SET_QUALITY
#define SPEEX_SET_QUALITY 4 |
◆ SPEEX_SET_SAMPLING_RATE
#define SPEEX_SET_SAMPLING_RATE 24 |
Set sampling rate used in bit-rate computation
◆ SPEEX_SET_SUBMODE_ENCODING
#define SPEEX_SET_SUBMODE_ENCODING 36 |
Set submode encoding in each frame (1 for yes, 0 for no, setting to no breaks the standard)
◆ SPEEX_SET_USER_HANDLER
#define SPEEX_SET_USER_HANDLER 22 |
Define a handler function for in-band user-defined request
◆ SPEEX_SET_VAD
Set VAD status (1 for on, 0 for off)
◆ SPEEX_SET_VBR
Set VBR on (1) or off (0)
◆ SPEEX_SET_VBR_MAX_BITRATE
#define SPEEX_SET_VBR_MAX_BITRATE 42 |
Sets the max bit-rate allowed in VBR mode
◆ SPEEX_SET_VBR_QUALITY
#define SPEEX_SET_VBR_QUALITY 14 |
Set quality value for VBR encoding (0-10)
◆ SPEEX_SUBMODE_BITS_PER_FRAME
#define SPEEX_SUBMODE_BITS_PER_FRAME 1 |
Query the size of an encoded frame for a particular sub-mode
◆ decode_func
typedef int(* decode_func) (void *state, SpeexBits *bits, void *out) |
◆ decoder_ctl_func
typedef int(* decoder_ctl_func) (void *state, int request, void *ptr) |
Function for controlling the decoder options
◆ decoder_destroy_func
typedef void(* decoder_destroy_func) (void *st) |
Decoder state destruction function
◆ decoder_init_func
typedef void*(* decoder_init_func) (const struct SpeexMode *mode) |
Decoder state initialization function
◆ encode_func
typedef int(* encode_func) (void *state, void *in, SpeexBits *bits) |
◆ encoder_ctl_func
typedef int(* encoder_ctl_func) (void *state, int request, void *ptr) |
Function for controlling the encoder options
◆ encoder_destroy_func
typedef void(* encoder_destroy_func) (void *st) |
Encoder state destruction function
◆ encoder_init_func
typedef void*(* encoder_init_func) (const struct SpeexMode *mode) |
Encoder state initialization function
◆ mode_query_func
typedef int(* mode_query_func) (const void *mode, int request, void *ptr) |
Query function for a mode
◆ SpeexMode
Struct defining a Speex mode
◆ speex_decode()
int speex_decode |
( |
void * |
state, |
|
|
SpeexBits * |
bits, |
|
|
float * |
out |
|
) |
| |
Uses an existing decoder state to decode one frame of speech from bit-stream bits. The output speech is saved written to out.
- Parameters
-
state | Decoder state |
bits | Bit-stream from which to decode the frame (NULL if the packet was lost) |
out | Where to write the decoded frame |
- Returns
- return status (0 for no error, -1 for end of stream, -2 corrupt stream)
◆ speex_decode_int()
int speex_decode_int |
( |
void * |
state, |
|
|
SpeexBits * |
bits, |
|
|
spx_int16_t * |
out |
|
) |
| |
Uses an existing decoder state to decode one frame of speech from bit-stream bits. The output speech is saved written to out.
- Parameters
-
state | Decoder state |
bits | Bit-stream from which to decode the frame (NULL if the packet was lost) |
out | Where to write the decoded frame |
- Returns
- return status (0 for no error, -1 for end of stream, -2 corrupt stream)
◆ speex_decoder_ctl()
int speex_decoder_ctl |
( |
void * |
state, |
|
|
int |
request, |
|
|
void * |
ptr |
|
) |
| |
Used like the ioctl function to control the encoder parameters
- Parameters
-
state | Decoder state |
request | ioctl-type request (one of the SPEEX_* macros) |
ptr | Data exchanged to-from function |
- Returns
- 0 if no error, -1 if request in unknown, -2 for invalid parameter
◆ speex_decoder_destroy()
void speex_decoder_destroy |
( |
void * |
state | ) |
|
Frees all resources associated to an existing decoder state.
- Parameters
-
state | State to be destroyed |
◆ speex_decoder_init()
void* speex_decoder_init |
( |
const SpeexMode * |
mode | ) |
|
Returns a handle to a newly created decoder state structure. For now, the mode argument can be &nb_mode or &wb_mode . In the future, more modes may be added. Note that for now if you have more than one channels to decode, you need one state per channel.
- Parameters
-
mode | Speex mode (one of speex_nb_mode or speex_wb_mode) |
- Returns
- A newly created decoder state or NULL if state allocation fails
◆ speex_encode()
int speex_encode |
( |
void * |
state, |
|
|
float * |
in, |
|
|
SpeexBits * |
bits |
|
) |
| |
Uses an existing encoder state to encode one frame of speech pointed to by "in". The encoded bit-stream is saved in "bits".
- Parameters
-
state | Encoder state |
in | Frame that will be encoded with a +-2^15 range. This data MAY be overwritten by the encoder and should be considered uninitialised after the call. |
bits | Bit-stream where the data will be written |
- Returns
- 0 if frame needs not be transmitted (DTX only), 1 otherwise
◆ speex_encode_int()
int speex_encode_int |
( |
void * |
state, |
|
|
spx_int16_t * |
in, |
|
|
SpeexBits * |
bits |
|
) |
| |
Uses an existing encoder state to encode one frame of speech pointed to by "in". The encoded bit-stream is saved in "bits".
- Parameters
-
state | Encoder state |
in | Frame that will be encoded with a +-2^15 range |
bits | Bit-stream where the data will be written |
- Returns
- 0 if frame needs not be transmitted (DTX only), 1 otherwise
◆ speex_encoder_ctl()
int speex_encoder_ctl |
( |
void * |
state, |
|
|
int |
request, |
|
|
void * |
ptr |
|
) |
| |
Used like the ioctl function to control the encoder parameters
- Parameters
-
state | Encoder state |
request | ioctl-type request (one of the SPEEX_* macros) |
ptr | Data exchanged to-from function |
- Returns
- 0 if no error, -1 if request in unknown, -2 for invalid parameter
◆ speex_encoder_destroy()
void speex_encoder_destroy |
( |
void * |
state | ) |
|
Frees all resources associated to an existing Speex encoder state.
- Parameters
-
state | Encoder state to be destroyed |
◆ speex_encoder_init()
void* speex_encoder_init |
( |
const SpeexMode * |
mode | ) |
|
Returns a handle to a newly created Speex encoder state structure. For now, the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes may be added. Note that for now if you have more than one channels to encode, you need one state per channel.
- Parameters
-
mode | The mode to use (either speex_nb_mode or speex_wb.mode) |
- Returns
- A newly created encoder state or NULL if state allocation fails
◆ speex_lib_ctl()
int speex_lib_ctl |
( |
int |
request, |
|
|
void * |
ptr |
|
) |
| |
Functions for controlling the behavior of libspeex
- Parameters
-
request | ioctl-type request (one of the SPEEX_LIB_* macros) |
ptr | Data exchanged to-from function |
- Returns
- 0 if no error, -1 if request in unknown, -2 for invalid parameter
◆ speex_lib_get_mode()
const SpeexMode* speex_lib_get_mode |
( |
int |
mode | ) |
|
Obtain one of the modes available
◆ speex_mode_query()
int speex_mode_query |
( |
const SpeexMode * |
mode, |
|
|
int |
request, |
|
|
void * |
ptr |
|
) |
| |
Query function for mode information
- Parameters
-
mode | Speex mode |
request | ioctl-type request (one of the SPEEX_* macros) |
ptr | Data exchanged to-from function |
- Returns
- 0 if no error, -1 if request in unknown, -2 for invalid parameter
◆ speex_mode_list
List of all modes available
◆ speex_nb_mode
◆ speex_uwb_mode
Default "ultra-wideband" mode
◆ speex_wb_mode