--- /dev/null
+/*\r
+** Copyright (C) 2002-2004 Erik de Castro Lopo <erikd@mega-nerd.com>\r
+**\r
+** This program is free software; you can redistribute it and/or modify\r
+** it under the terms of the GNU General Public License as published by\r
+** the Free Software Foundation; either version 2 of the License, or\r
+** (at your option) any later version.\r
+**\r
+** This program is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+** GNU General Public License for more details.\r
+**\r
+** You should have received a copy of the GNU General Public License\r
+** along with this program; if not, write to the Free Software\r
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\r
+*/\r
+\r
+/*\r
+** API documentation is available here:\r
+** http://www.mega-nerd.com/SRC/api.html\r
+*/\r
+\r
+#ifndef SAMPLERATE_H\r
+#define SAMPLERATE_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+\r
+/* Opaque data type SRC_STATE. */\r
+typedef struct SRC_STATE_tag SRC_STATE ;\r
+\r
+/* SRC_DATA is used to pass data to src_simple() and src_process(). */\r
+typedef struct\r
+{ float *data_in, *data_out ;\r
+\r
+ long input_frames, output_frames ;\r
+ long input_frames_used, output_frames_gen ;\r
+\r
+ int end_of_input ;\r
+\r
+ double src_ratio ;\r
+} SRC_DATA ;\r
+\r
+/* SRC_CB_DATA is used with callback based API. */\r
+typedef struct\r
+{ long frames ;\r
+ float *data_in ;\r
+} SRC_CB_DATA ;\r
+\r
+/*\r
+** User supplied callback function type for use with src_callback_new()\r
+** and src_callback_read(). First parameter is the same pointer that was\r
+** passed into src_callback_new(). Second parameter is pointer to a\r
+** pointer. The user supplied callback function must modify *data to\r
+** point to the start of the user supplied float array. The user supplied\r
+** function must return the number of frames that **data points to.\r
+*/\r
+\r
+typedef long (*src_callback_t) (void *cb_data, float **data) ;\r
+\r
+/*\r
+** Standard initialisation function : return an anonymous pointer to the\r
+** internal state of the converter. Choose a converter from the enums below.\r
+** Error returned in *error.\r
+*/\r
+\r
+SRC_STATE* src_new (int converter_type, int channels, int *error) ;\r
+\r
+/*\r
+** Initilisation for callback based API : return an anonymous pointer to the\r
+** internal state of the converter. Choose a converter from the enums below.\r
+** The cb_data pointer can point to any data or be set to NULL. Whatever the\r
+** value, when processing, user supplied function "func" gets called with\r
+** cb_data as first parameter.\r
+*/\r
+\r
+SRC_STATE* src_callback_new (src_callback_t func, int converter_type, int channels,\r
+ int *error, void* cb_data) ;\r
+\r
+/*\r
+** Cleanup all internal allocations.\r
+** Always returns NULL.\r
+*/\r
+\r
+SRC_STATE* src_delete (SRC_STATE *state) ;\r
+\r
+/*\r
+** Standard processing function.\r
+** Returns non zero on error.\r
+*/\r
+\r
+int src_process (SRC_STATE *state, SRC_DATA *data) ;\r
+\r
+/*\r
+** Callback based processing function. Read up to frames worth of data from\r
+** the converter int *data and return frames read or -1 on error.\r
+*/\r
+long src_callback_read (SRC_STATE *state, double src_ratio, long frames, float *data) ;\r
+\r
+/*\r
+** Simple interface for performing a single conversion from input buffer to\r
+** output buffer at a fixed conversion ratio.\r
+** Simple interface does not require initialisation as it can only operate on\r
+** a single buffer worth of audio.\r
+*/\r
+\r
+int src_simple (SRC_DATA *data, int converter_type, int channels) ;\r
+\r
+/*\r
+** This library contains a number of different sample rate converters,\r
+** numbered 0 through N.\r
+**\r
+** Return a string giving either a name or a more full description of each\r
+** sample rate converter or NULL if no sample rate converter exists for\r
+** the given value. The converters are sequentially numbered from 0 to N.\r
+*/\r
+\r
+const char *src_get_name (int converter_type) ;\r
+const char *src_get_description (int converter_type) ;\r
+const char *src_get_version (void) ;\r
+\r
+/*\r
+** Set a new SRC ratio. This allows step responses\r
+** in the conversion ratio.\r
+** Returns non zero on error.\r
+*/\r
+\r
+int src_set_ratio (SRC_STATE *state, double new_ratio) ;\r
+\r
+/*\r
+** Reset the internal SRC state.\r
+** Does not modify the quality settings.\r
+** Does not free any memory allocations.\r
+** Returns non zero on error.\r
+*/\r
+\r
+int src_reset (SRC_STATE *state) ;\r
+\r
+/*\r
+** Return TRUE if ratio is a valid conversion ratio, FALSE\r
+** otherwise.\r
+*/\r
+\r
+int src_is_valid_ratio (double ratio) ;\r
+\r
+/*\r
+** Return an error number.\r
+*/\r
+\r
+int src_error (SRC_STATE *state) ;\r
+\r
+/*\r
+** Convert the error number into a string.\r
+*/\r
+const char* src_strerror (int error) ;\r
+\r
+/*\r
+** The following enums can be used to set the interpolator type\r
+** using the function src_set_converter().\r
+*/\r
+\r
+enum\r
+{\r
+ SRC_SINC_BEST_QUALITY = 0,\r
+ SRC_SINC_MEDIUM_QUALITY = 1,\r
+ SRC_SINC_FASTEST = 2,\r
+ SRC_ZERO_ORDER_HOLD = 3,\r
+ SRC_LINEAR = 4\r
+} ;\r
+\r
+/*\r
+** Extra helper functions for converting from short to float and\r
+** back again.\r
+*/\r
+\r
+void src_short_to_float_array (const short *in, float *out, int len) ;\r
+void src_float_to_short_array (const float *in, short *out, int len) ;\r
+\r
+\r
+#ifdef __cplusplus\r
+} /* extern "C" */\r
+#endif /* __cplusplus */\r
+\r
+#endif /* SAMPLERATE_H */\r
+\r
+/*\r
+** Do not edit or modify anything in this comment block.\r
+** The arch-tag line is a file identity tag for the GNU Arch\r
+** revision control system.\r
+**\r
+** arch-tag: 5421ef3e-c898-4ec3-8671-ea03d943ee00\r
+*/\r
+\r