2 * Copyright (C) <2001> David Schleef <ds@schleef.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #ifndef __RESAMPLE_H__
22 #define __RESAMPLE_H__
24 #include "functable.h"
28 RESAMPLE_FORMAT_S16 = 0,
34 typedef void (*ResampleCallback) (void *);
36 typedef struct _ResampleState ResampleState;
38 struct _ResampleState {
42 ResampleFormat format;
51 /* internal parameters */
62 AudioresampleBufferQueue *queue;
92 void resample_init (void);
93 void resample_cleanup (void);
95 ResampleState *resample_new (void);
96 void resample_free (ResampleState *state);
98 void resample_add_input_data (ResampleState * r, void *data, int size,
99 ResampleCallback free_func, void *closure);
100 void resample_input_eos (ResampleState *r);
102 int resample_get_output_size_for_input (ResampleState * r, int size);
103 int resample_get_output_size (ResampleState *r);
104 int resample_get_output_data (ResampleState *r, void *data, int size);
106 void resample_set_filter_length (ResampleState *r, int length);
107 void resample_set_input_rate (ResampleState *r, double rate);
108 void resample_set_output_rate (ResampleState *r, double rate);
109 void resample_set_n_channels (ResampleState *r, int n_channels);
110 void resample_set_format (ResampleState *r, ResampleFormat format);
111 void resample_set_method (ResampleState *r, int method);
112 int resample_format_size (ResampleFormat format);
114 #endif /* __RESAMPLE_H__ */