38 #ifndef SPEEX_RESAMPLER_H 39 #define SPEEX_RESAMPLER_H 41 #define OUTSIDE_SPEEX 1 42 #define RANDOM_PREFIX ws_codec 43 #include "ws_symbol_export.h" 55 #error "Please define RANDOM_PREFIX (above) to something specific to your project to prevent symbol name clashes" 58 #define CAT_PREFIX2(a,b) a ## b 59 #define CAT_PREFIX(a,b) CAT_PREFIX2(a, b) 61 #define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init) 62 #define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac) 63 #define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy) 64 #define speex_resampler_process_float CAT_PREFIX(RANDOM_PREFIX,_resampler_process_float) 65 #define speex_resampler_process_int CAT_PREFIX(RANDOM_PREFIX,_resampler_process_int) 66 #define speex_resampler_process_interleaved_float CAT_PREFIX(RANDOM_PREFIX,_resampler_process_interleaved_float) 67 #define speex_resampler_process_interleaved_int CAT_PREFIX(RANDOM_PREFIX,_resampler_process_interleaved_int) 68 #define speex_resampler_set_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_set_rate) 69 #define speex_resampler_get_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_get_rate) 70 #define speex_resampler_set_rate_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_set_rate_frac) 71 #define speex_resampler_get_ratio CAT_PREFIX(RANDOM_PREFIX,_resampler_get_ratio) 72 #define speex_resampler_set_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_set_quality) 73 #define speex_resampler_get_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_get_quality) 74 #define speex_resampler_set_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_input_stride) 75 #define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_stride) 76 #define speex_resampler_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_output_stride) 77 #define speex_resampler_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_stride) 78 #define speex_resampler_get_input_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_latency) 79 #define speex_resampler_get_output_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_latency) 80 #define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip_zeros) 81 #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem) 82 #define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror) 84 #define spx_int16_t short 85 #define spx_int32_t int 86 #define spx_uint16_t unsigned short 87 #define spx_uint32_t unsigned int 91 #include "speexdsp_types.h" 99 #define SPEEX_RESAMPLER_QUALITY_MAX 10 100 #define SPEEX_RESAMPLER_QUALITY_MIN 0 101 #define SPEEX_RESAMPLER_QUALITY_DEFAULT 4 102 #define SPEEX_RESAMPLER_QUALITY_VOIP 3 103 #define SPEEX_RESAMPLER_QUALITY_DESKTOP 5 106 RESAMPLER_ERR_SUCCESS = 0,
107 RESAMPLER_ERR_ALLOC_FAILED = 1,
108 RESAMPLER_ERR_BAD_STATE = 2,
109 RESAMPLER_ERR_INVALID_ARG = 3,
110 RESAMPLER_ERR_PTR_OVERLAP = 4,
112 RESAMPLER_ERR_MAX_ERROR
128 spx_uint32_t in_rate,
129 spx_uint32_t out_rate,
147 spx_uint32_t ratio_num,
148 spx_uint32_t ratio_den,
149 spx_uint32_t in_rate,
150 spx_uint32_t out_rate,
170 spx_uint32_t channel_index,
172 spx_uint32_t *in_len,
174 spx_uint32_t *out_len);
187 spx_uint32_t channel_index,
188 const spx_int16_t *in,
189 spx_uint32_t *in_len,
191 spx_uint32_t *out_len);
204 spx_uint32_t *in_len,
206 spx_uint32_t *out_len);
218 const spx_int16_t *in,
219 spx_uint32_t *in_len,
221 spx_uint32_t *out_len);
229 spx_uint32_t in_rate,
230 spx_uint32_t out_rate);
238 spx_uint32_t *in_rate,
239 spx_uint32_t *out_rate);
250 spx_uint32_t ratio_num,
251 spx_uint32_t ratio_den,
252 spx_uint32_t in_rate,
253 spx_uint32_t out_rate);
262 spx_uint32_t *ratio_num,
263 spx_uint32_t *ratio_den);
286 spx_uint32_t stride);
293 spx_uint32_t *stride);
300 spx_uint32_t stride);
307 spx_uint32_t *stride);
338 WS_DLL_PUBLIC
const char *speex_resampler_strerror(
int err);
Definition: resample.c:113