56
57
/** Set quality value */
57
58
#define SPEEX_SET_QUALITY 4
58
59
/** Get current quality setting */
59
#define SPEEX_GET_QUALITY 5
60
/* #define SPEEX_GET_QUALITY 5 -- Doesn't make much sense, does it? */
61
62
/** Set sub-mode to use */
62
63
#define SPEEX_SET_MODE 6
93
94
/** Get current bit-rate used by the encoder or decoder */
94
95
#define SPEEX_GET_BITRATE 19
96
/**Define a handler function for in-band Speex request*/
97
/** Define a handler function for in-band Speex request*/
97
98
#define SPEEX_SET_HANDLER 20
99
/**Define a handler function for in-band user-defined request*/
100
/** Define a handler function for in-band user-defined request*/
100
101
#define SPEEX_SET_USER_HANDLER 22
102
103
/** Set sampling rate used in bit-rate computation */
129
130
/** Set submode encoding in each frame (1 for yes, 0 for no, setting to no breaks the standard) */
130
131
#define SPEEX_SET_SUBMODE_ENCODING 36
132
/** Get submode encoding in each frame */
132
133
#define SPEEX_GET_SUBMODE_ENCODING 37
134
/*#define SPEEX_SET_SUBMODE_ENCODING 38*/
135
/*#define SPEEX_SET_LOOKAHEAD 38*/
136
/** Returns the lookahead used by Speex */
136
137
#define SPEEX_GET_LOOKAHEAD 39
139
/** Sets tuning for packet-loss concealment (expected loss rate) */
140
#define SPEEX_SET_PLC_TUNING 40
141
/** Gets tuning for PLC */
142
#define SPEEX_GET_PLC_TUNING 41
139
144
/* Used internally, not to be used in applications */
140
145
/** Used internally*/
173
/** Get major Speex version */
168
174
#define SPEEX_LIB_GET_MAJOR_VERSION 1
175
/** Get minor Speex version */
169
176
#define SPEEX_LIB_GET_MINOR_VERSION 3
177
/** Get micro Speex version */
170
178
#define SPEEX_LIB_GET_MICRO_VERSION 5
179
/** Get extra Speex version */
171
180
#define SPEEX_LIB_GET_EXTRA_VERSION 7
181
/** Get Speex version string */
172
182
#define SPEEX_LIB_GET_VERSION_STRING 9
174
184
/*#define SPEEX_LIB_SET_ALLOC_FUNC 10
289
304
/** Uses an existing encoder state to encode one frame of speech pointed to by
290
305
"in". The encoded bit-stream is saved in "bits".
291
306
@param state Encoder state
292
@param in Frame that will be encoded with a +-2^16 range
307
@param in Frame that will be encoded with a +-2^15 range
293
308
@param bits Bit-stream where the data will be written
309
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
295
311
int speex_encode(void *state, float *in, SpeexBits *bits);
297
313
/** Uses an existing encoder state to encode one frame of speech pointed to by
298
314
"in". The encoded bit-stream is saved in "bits".
299
315
@param state Encoder state
300
@param in Frame that will be encoded with a +-2^16 range
316
@param in Frame that will be encoded with a +-2^15 range
301
317
@param bits Bit-stream where the data will be written
318
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
303
int speex_encode_int(void *state, short *in, SpeexBits *bits);
320
int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits);
305
322
/** Used like the ioctl function to control the encoder parameters
307
324
* @param state Encoder state
308
325
* @param request ioctl-type request (one of the SPEEX_* macros)
309
326
* @param ptr Data exchanged to-from function
310
* @return 0 if frame needs not be transmitted (DTX only), 1 otherwise
327
* @return 0 if no error, -1 if request in unknown
312
329
int speex_encoder_ctl(void *state, int request, void *ptr);
334
351
* @param state Decoder state
335
352
* @param bits Bit-stream from which to decode the frame (NULL if the packet was lost)
336
353
* @param out Where to write the decoded frame
337
* @return return status (0 for no error, -1 for end of stream, -2 other)
354
* @return return status (0 for no error, -1 for end of stream, -2 corrupt stream)
339
356
int speex_decode(void *state, SpeexBits *bits, float *out);
344
361
* @param state Decoder state
345
362
* @param bits Bit-stream from which to decode the frame (NULL if the packet was lost)
346
363
* @param out Where to write the decoded frame
347
* @return return status (0 for no error, -1 for end of stream, -2 other)
364
* @return return status (0 for no error, -1 for end of stream, -2 corrupt stream)
349
int speex_decode_int(void *state, SpeexBits *bits, short *out);
366
int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out);
351
368
/** Used like the ioctl function to control the encoder parameters
353
370
* @param state Decoder state
354
371
* @param request ioctl-type request (one of the SPEEX_* macros)
355
372
* @param ptr Data exchanged to-from function
356
* @return 0 for no error, 1 if a terminator is reached, 2 for another error
373
* @return 0 if no error, -1 if request in unknown
358
375
int speex_decoder_ctl(void *state, int request, void *ptr);
389
406
/** List of all modes available */
390
extern const SpeexMode *speex_mode_list[SPEEX_NB_MODES];
407
extern const SpeexMode * const speex_mode_list[SPEEX_NB_MODES];
409
/** Obtain one of the modes available */
410
const SpeexMode * speex_lib_get_mode (int mode);
392
412
#ifdef __cplusplus