From 49c81f6d50d8bde02f0ecad0595d2467403a4bfb Mon Sep 17 00:00:00 2001 From: Jonathan Oakley Date: Tue, 24 Sep 2024 08:13:43 +0100 Subject: [PATCH] Fix error playing WAV data from RAM (#61) The computation of the number of samples didn't take into account the number of channels --- src/ResamplingReader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ResamplingReader.h b/src/ResamplingReader.h index 0cf2b38..6b815f1 100644 --- a/src/ResamplingReader.h +++ b/src/ResamplingReader.h @@ -83,7 +83,7 @@ class ResamplingReader { break; result = playRaw((TArray*)((char*) array + (36 + infoTagsSize + sizeof wav_data_hdr)), - wav_data_hdr.data_bytes / 2, + wav_data_hdr.data_bytes / hdr.num_channels / 2, hdr.num_channels); } while (0);