Mercurial > hg > constant-q-cpp
changeset 98:fb5bcb44277a
Write diff of tail as well
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Sat, 10 May 2014 11:57:59 +0100 |
parents | e599e0b13388 |
children | 54c4b7719ff2 |
files | cpp-qm-dsp/processfile.cpp |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/cpp-qm-dsp/processfile.cpp Sat May 10 11:48:21 2014 +0100 +++ b/cpp-qm-dsp/processfile.cpp Sat May 10 11:57:59 2014 +0100 @@ -158,13 +158,26 @@ vector<double> r2 = cqi.getRemainingOutput(); sf_writef_double(sndfileOut, r1.data(), r1.size()); + if (doDiff) { + for (int i = 0; i < (int)r1.size(); ++i) { + r1[i] -= buffer[outframe + i - latency]; + } + sf_writef_double(sndDiffFile, r1.data(), r1.size()); + } + outframe += r1.size(); + sf_writef_double(sndfileOut, r2.data(), r2.size()); - - outframe += r1.size(); + if (doDiff) { + for (int i = 0; i < (int)r2.size(); ++i) { + r2[i] -= buffer[outframe + i - latency]; + } + sf_writef_double(sndDiffFile, r2.data(), r2.size()); + } outframe += r2.size(); sf_close(sndfile); sf_close(sndfileOut); + if (doDiff) { sf_close(sndDiffFile); }