Skip to content

Commit

Permalink
[GME Input] Fix decoder output sample count
Browse files Browse the repository at this point in the history
The output has been assigning twice as many samples as it was supposed
to ever since commit 8d851e5, which
ended up generating the correct 1024 samples (2048 per GME parameter),
but assigned 2048 to the AudioChunk, which resulted in over-reading the
audio buffer, and thankfully not crashing, but instead causing an awful
sound distortion effect as random memory contents were played as PCM
audio.

Fixes #320

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
  • Loading branch information
kode54 committed Aug 5, 2022
1 parent 93e3dd7 commit 5019c6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Plugins/GME/GameDecoder.m
Expand Up @@ -198,7 +198,7 @@ - (AudioChunk *)readAudio {
//(From gme.txt) If track length, then use it. If loop length, play for intro + loop * 2. Otherwise, default to 2.5 minutes
// GME will always generate samples. There's no real EOS.

[chunk assignSamples:sampleBuffer frameCount:numSamples];
[chunk assignSamples:sampleBuffer frameCount:frames];

return chunk;
}
Expand Down

0 comments on commit 5019c6b

Please sign in to comment.