[Scummvm-git-logs] scummvm master -> fd6c1579c5040e7002c99815040b33919b440965

eriktorbjorn noreply at scummvm.org
Sun Jun 15 15:27:04 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
fd6c1579c5 AWE: Fix raw sound effect pitch (bug #16014)


Commit: fd6c1579c5040e7002c99815040b33919b440965
    https://github.com/scummvm/scummvm/commit/fd6c1579c5040e7002c99815040b33919b440965
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-06-15T17:25:42+02:00

Commit Message:
AWE: Fix raw sound effect pitch (bug #16014)

They were played as 16-bit audio instead of 8-bit audio, causing them to
be played at effectively twice the intended sample rate. We were also
playing the 8-byte header as audio data.

Changed paths:
    engines/awe/sound.cpp


diff --git a/engines/awe/sound.cpp b/engines/awe/sound.cpp
index 556099d609c..06e005d9f3c 100644
--- a/engines/awe/sound.cpp
+++ b/engines/awe/sound.cpp
@@ -65,11 +65,18 @@ void Sound::playSoundRaw(byte channel, const byte *data, size_t size,
 		int freq, byte volume) {
 	assert(channel < MAX_CHANNELS);
 
+	uint length = READ_BE_UINT16(data) * 2;
+
+	if (length > size - 8) {
+		warning("playSoundRaw: Length %d exceeds resource data length %ld", length, size);
+		length = size - 8;
+	}
+
 	Common::MemoryReadStream *stream =
-		new Common::MemoryReadStream(data, size);
+		new Common::MemoryReadStream(data + 8, length);
 	Audio::AudioStream *sound =
 		Audio::makeRawStream(stream, freq,
-			Audio::FLAG_16BITS,
+			0,
 			DisposeAfterUse::YES);
 	_mixer->playStream(Audio::Mixer::kSFXSoundType, &_channels[channel],
 		sound, -1, 255, 0, DisposeAfterUse::YES);




More information about the Scummvm-git-logs mailing list