Skip to content

Commit a07181e

Browse files
committed
Use multiple channels
1 parent d5338f6 commit a07181e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

libspeexdsp/testresample2.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,17 @@
4343
#define INBLOCK 1024
4444
#define RATE 48000
4545

46-
int main()
46+
int main(int argc, char **argv)
4747
{
4848
spx_uint32_t i;
4949
float *fin, *fout;
50-
int rate = 1000, off = 0, avail = INBLOCK;
51-
SpeexResamplerState *st = speex_resampler_init(1, RATE, RATE, 4, NULL);
50+
int rate = 1000, off = 0, avail = INBLOCK, channels = 1;
51+
52+
if (argc > 1) {
53+
channels = atoi(argv[1]);
54+
}
55+
56+
SpeexResamplerState *st = speex_resampler_init(channels, RATE, RATE, 4, NULL);
5257
speex_resampler_set_rate(st, RATE, rate);
5358
speex_resampler_skip_zeros(st);
5459

0 commit comments

Comments
 (0)