From 9290c9a11f4aea63431c62b3f21b9d59d015bff9 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 23 Oct 2005 22:04:51 +0000 Subject: multichannel fix svn path=/trunk/externals/tb/; revision=3761 --- sndfiler/sndfiler.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sndfiler/sndfiler.c b/sndfiler/sndfiler.c index 29c692a..c9e0fb4 100644 --- a/sndfiler/sndfiler.c +++ b/sndfiler/sndfiler.c @@ -221,6 +221,7 @@ static void sndfiler_read_cb(t_sndfiler * x, int argc, t_atom* argv) t_float * item = alloca(maxchannels * sizeof(t_float)); + t_int ** syncdata = getbytes(sizeof(t_int*) * 5); #if (_POSIX_MEMLOCK - 0) >= 200112L @@ -235,14 +236,14 @@ static void sndfiler_read_cb(t_sndfiler * x, int argc, t_atom* argv) for (i = 0; i != info.frames; ++i) { - sf_read_float(sndfile, item, 1); + sf_read_float(sndfile, item, info.channels); - for (j = 0; j != channel_count; ++j) + for (j = 0; j != info.channels; ++j) { - if (j < minchannels) + if (j < channel_count) + { helper_arrays[j][i] = item[j]; - else - helper_arrays[j][i] = 0; + } } } #if (_POSIX_MEMLOCK - 0) >= 200112L -- cgit v1.2.1