mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 12:48:40 -05:00
2cf6ea1f89
- Try to guess at a default between portaudio and alsa for now - changed "samplerate.h" to <samplerate.h> in resample.c git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@76 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
29 lines
639 B
C
29 lines
639 B
C
#include <stdio.h>
|
|
#include <samplerate.h>
|
|
|
|
int resample_( float din[], float dout[], double *samfac, int *jz)
|
|
{
|
|
SRC_DATA src_data;
|
|
int input_len;
|
|
int output_len;
|
|
int ierr;
|
|
double src_ratio;
|
|
|
|
src_ratio=*samfac;
|
|
input_len=*jz;
|
|
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;
|
|
|
|
ierr=src_simple(&src_data,2,1);
|
|
*jz=output_len;
|
|
/* printf("%d %d %d %d %f\n",input_len,output_len,src_data.input_frames_used,
|
|
src_data.output_frames_gen,src_ratio);
|
|
*/
|
|
return ierr;
|
|
}
|