2005-12-22 11:40:53 -05:00
|
|
|
#include <stdio.h>
|
2006-01-10 11:36:04 -05:00
|
|
|
#include <samplerate.h>
|
2005-12-22 11:40:53 -05:00
|
|
|
|
2007-01-11 16:25:52 -05:00
|
|
|
int resample_(float din[], int *jzin, int *conv_type, int *channels,
|
|
|
|
double *samfac, float dout[], int *jzout)
|
2005-12-22 11:40:53 -05:00
|
|
|
{
|
|
|
|
SRC_DATA src_data;
|
|
|
|
int input_len;
|
|
|
|
int output_len;
|
|
|
|
int ierr;
|
|
|
|
double src_ratio;
|
|
|
|
|
|
|
|
src_ratio=*samfac;
|
2007-01-11 16:25:52 -05:00
|
|
|
input_len=*jzin;
|
2005-12-22 11:40:53 -05:00
|
|
|
output_len=(int) (input_len*src_ratio);
|
|
|
|
|
|
|
|
src_data.data_in=din;
|
|
|
|
src_data.data_out=dout;
|
|
|
|
src_data.src_ratio=src_ratio;
|
|
|
|
src_data.input_frames=input_len;
|
|
|
|
src_data.output_frames=output_len;
|
|
|
|
|
2007-01-11 16:25:52 -05:00
|
|
|
ierr=src_simple(&src_data,*conv_type,*channels);
|
|
|
|
*jzout=output_len;
|
2005-12-22 11:40:53 -05:00
|
|
|
return ierr;
|
|
|
|
}
|