comparison include/SDL_audio.h @ 3021:f3dcf04412cf

First shot at new audio resampling code.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 11 Jan 2009 04:46:42 +0000
parents e532417a6977
children d3baf5ac4e37
comparison
equal deleted inserted replaced
3020:70d876a0b90e 3021:f3dcf04412cf
145 int needed; /* Set to 1 if conversion possible */ 145 int needed; /* Set to 1 if conversion possible */
146 SDL_AudioFormat src_format; /* Source audio format */ 146 SDL_AudioFormat src_format; /* Source audio format */
147 SDL_AudioFormat dst_format; /* Target audio format */ 147 SDL_AudioFormat dst_format; /* Target audio format */
148 double rate_incr; /* Rate conversion increment */ 148 double rate_incr; /* Rate conversion increment */
149 Uint8 *buf; /* Buffer to hold entire audio data */ 149 Uint8 *buf; /* Buffer to hold entire audio data */
150 Uint8 *coeff; /* Filter coefficients: either big windowed sinc filter, or 6 IIR lowpass coefficients */
151 Uint8 *state_buf; /* Sample history for either the FIR or IIR filter. For IIR filter, first two elements are X, second two are Y, and state_pos toggles the order */
152 int state_pos; /* Position in the state */
153 int len_sinc; /* Length of windowed sinc filter, in appropriate units (not necessarily bytes) */
154 int len; /* Length of original audio buffer */ 150 int len; /* Length of original audio buffer */
155 int len_cvt; /* Length of converted audio buffer */ 151 int len_cvt; /* Length of converted audio buffer */
156 int len_mult; /* buffer must be len*len_mult big */ 152 int len_mult; /* buffer must be len*len_mult big */
157 int len_div; /* destination length = len_mult / len_div * src length */ 153 double len_ratio; /* Given len, final size is len*len_ratio */
158 double len_ratio; /* Given len, final size is len*len_ratio ( len_ratio = len_mult / len_div ) */
159 SDL_AudioFilter filters[10]; /* Filter list */ 154 SDL_AudioFilter filters[10]; /* Filter list */
160 int filter_index; /* Current audio conversion function */ 155 int filter_index; /* Current audio conversion function */
161 } SDL_AudioCVT; 156 } SDL_AudioCVT;
162 157
163 158