From a07181ec87c3c95f5f1b893b7b1c4b22f08c73d6 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Thu, 5 May 2022 19:40:57 +0200 Subject: [PATCH] Use multiple channels --- libspeexdsp/testresample2.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libspeexdsp/testresample2.c b/libspeexdsp/testresample2.c index db865556..557a7a61 100644 --- a/libspeexdsp/testresample2.c +++ b/libspeexdsp/testresample2.c @@ -43,12 +43,17 @@ #define INBLOCK 1024 #define RATE 48000 -int main() +int main(int argc, char **argv) { spx_uint32_t i; float *fin, *fout; - int rate = 1000, off = 0, avail = INBLOCK; - SpeexResamplerState *st = speex_resampler_init(1, RATE, RATE, 4, NULL); + int rate = 1000, off = 0, avail = INBLOCK, channels = 1; + + if (argc > 1) { + channels = atoi(argv[1]); + } + + SpeexResamplerState *st = speex_resampler_init(channels, RATE, RATE, 4, NULL); speex_resampler_set_rate(st, RATE, rate); speex_resampler_skip_zeros(st);