2005-12-22 11:40:53 -05:00
|
|
|
#include <stdio.h>
|
2007-12-31 10:15:55 -05:00
|
|
|
//#ifdef CVF
|
2007-12-21 13:40:47 -05:00
|
|
|
#include "samplerate.h"
|
|
|
|
//#else
|
|
|
|
//#include <samplerate.h>
|
|
|
|
//#endif
|
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;
|
|
|
|
}
|