123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- #ifndef SAMPLERATE_H
- #define SAMPLERATE_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef struct SRC_STATE_tag SRC_STATE ;
- typedef struct
- { float *data_in, *data_out ;
- long input_frames, output_frames ;
- long input_frames_used, output_frames_gen ;
- int end_of_input ;
- double src_ratio ;
- } SRC_DATA ;
- typedef struct
- { long frames ;
- float *data_in ;
- } SRC_CB_DATA ;
- typedef long (*src_callback_t) (void *cb_data, float **data) ;
- SRC_STATE* src_new (int converter_type, int channels, int *error) ;
- SRC_STATE* src_callback_new (src_callback_t func, int converter_type, int channels,
- int *error, void* cb_data) ;
- SRC_STATE* src_delete (SRC_STATE *state) ;
- int src_process (SRC_STATE *state, SRC_DATA *data) ;
- long src_callback_read (SRC_STATE *state, double src_ratio, long frames, float *data) ;
- int src_simple (SRC_DATA *data, int converter_type, int channels) ;
- const char *src_get_name (int converter_type) ;
- const char *src_get_description (int converter_type) ;
- const char *src_get_version (void) ;
- int src_set_ratio (SRC_STATE *state, double new_ratio) ;
- int src_reset (SRC_STATE *state) ;
- int src_is_valid_ratio (double ratio) ;
- int src_error (SRC_STATE *state) ;
- const char* src_strerror (int error) ;
- enum
- {
- SRC_SINC_BEST_QUALITY = 0,
- SRC_SINC_MEDIUM_QUALITY = 1,
- SRC_SINC_FASTEST = 2,
- SRC_ZERO_ORDER_HOLD = 3,
- SRC_LINEAR = 4,
- } ;
- void src_short_to_float_array (const short *in, float *out, int len) ;
- void src_float_to_short_array (const float *in, short *out, int len) ;
- void src_int_to_float_array (const int *in, float *out, int len) ;
- void src_float_to_int_array (const float *in, int *out, int len) ;
- #ifdef __cplusplus
- }
- #endif
- #endif
|