shithub: cstory

Download patch

ref: d80adf9cc8e5bc5121f621dac7ce5c14eee1c275
parent: 7300157f544b196f68f1514233b8c1774281d0e3
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Sep 5 17:41:40 EDT 2019

Comment on a bug in MakePixToneObject

--- a/src/Sound.cpp
+++ b/src/Sound.cpp
@@ -320,7 +320,7 @@
 	memcpy(wav_header.data, data, 4);
 	wav_header.sample_alignment = (wav_header.bit_depth / 8) * wav_header.num_channels;
 	wav_header.byte_rate = (wav_header.bit_depth / 8) * wav_header.num_channels * wav_header.sample_rate;
-	wav_header.data_bytes = wav_header.sample_alignment * ptp->size;
+	wav_header.data_bytes = wav_header.sample_alignment * ptp->size;	// Note that this uses ptp->size, not sample_count. If this header were ever used, it would be incorrect.
 	wav_header.wav_size = wav_header.data_bytes + 36;
 
 	ptp_pointer = ptp;