From 8bf52d4c11d7920fe530279a3758f220edcef0b6 Mon Sep 17 00:00:00 2001 From: Hideaki Tai Date: Tue, 13 Apr 2021 23:35:52 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20the=20start=20of=20the=20arg=20=E2=80=9Ct?= =?UTF-8?q?ime=E2=80=9D=20is=20not=20zero=20(#386)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the first call of funcs[0](time), time should be zero but it was not. --- src/AudioFileSourceFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AudioFileSourceFunction.cpp b/src/AudioFileSourceFunction.cpp index 48dd59f..9e86eff 100644 --- a/src/AudioFileSourceFunction.cpp +++ b/src/AudioFileSourceFunction.cpp @@ -71,7 +71,7 @@ uint32_t AudioFileSourceFunction::read(void* data, uint32_t len) { i += 1; } else { // data bytes - float time = (float)p / (float)wav_header.format.avg_bytes_per_sec; + float time = (float)(p - sizeof(WavHeader)) / (float)wav_header.format.avg_bytes_per_sec; float v = funcs[0](time); for (size_t ch = 0; ch < wav_header.format.channels; ++ch) { if (!is_unique && ch > 0)