[xiph-commits] r12456 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Mon Feb 12 06:51:34 PST 2007
Author: jm
Date: 2007-02-12 06:51:32 -0800 (Mon, 12 Feb 2007)
New Revision: 12456
Modified:
trunk/speex/libspeex/testresample.c
Log:
updated example for API change.
Modified: trunk/speex/libspeex/testresample.c
===================================================================
--- trunk/speex/libspeex/testresample.c 2007-02-12 14:50:06 UTC (rev 12455)
+++ trunk/speex/libspeex/testresample.c 2007-02-12 14:51:32 UTC (rev 12456)
@@ -48,8 +48,8 @@
short *out;
float *fin, *fout;
int count = 0;
- SpeexResamplerState *st = speex_resampler_init(1, 8000, 12000, 8000, 12000, 5);
- speex_resampler_set_rate(st, 16000, 8001, 8000, 15999);
+ SpeexResamplerState *st = speex_resampler_init(1, 8000, 12000, 10);
+ speex_resampler_set_rate(st, 8000, 15999);
speex_resampler_skip_zeros(st);
in = malloc(NN*sizeof(short));
@@ -67,9 +67,12 @@
fin[i]=in[i];
in_len = NN;
out_len = 2*NN;
+ /*if (count==2)
+ speex_resampler_set_quality(st, 10);*/
speex_resampler_process_float(st, 0, fin, &in_len, fout, &out_len);
for (i=0;i<out_len;i++)
out[i]=floor(.5+fout[i]);
+ /*speex_warning_int("writing", out_len);*/
fwrite(out, sizeof(short), out_len, stdout);
count++;
}
More information about the commits
mailing list