[Scummvm-tracker] [ScummVM :: Bugs] #16393: PS3: Broken Sword 1 - Distorted noise instead of speech
ScummVM :: Bugs
trac at scummvm.org
Thu Jan 8 00:01:16 UTC 2026
#16393: PS3: Broken Sword 1 - Distorted noise instead of speech
------------------------+-----------------------------
Reporter: TwistedZeon | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: Audio
Version: | Resolution:
Keywords: | Game: Broken Sword 1
------------------------+-----------------------------
Comment (by dwatteau):
Thanks for reporting this.
I can reproduce the issue on that OSXPPC Linux desktop I have (similar
big-endian PowerPC processor).
I'm using the "original version" that GOG ships in its bonus; speech &
audio and in Ogg Vorbis, and I think the handling of this file format is
part of this bug (see below).
With the current code on `branch-3-0`, on my big-endian setup I got this:
* Windows GOG release (Vorbis music & spech): FAIL
* PSX demo: FAIL
* Macintosh demo: speech OK, serveSample() FAIL
* Windows demo: OK
(the demos being hosted on our demos page.)
If I do something like this (which is similar to what Andy committed and
then reverted, but with a MKTAG() paranoid change, and a speech fix as
well):
{{{
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index d38ce46512c..eefad722e86 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -41,7 +41,11 @@
namespace Sword1 {
-#define SPEECH_FLAGS (Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN)
+#ifdef SCUMM_LITTLE_ENDIAN
+#define AUDIO_FLAGS (Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN)
+#else
+#define AUDIO_FLAGS (Audio::FLAG_16BITS | Audio::FLAG_BIG_ENDIAN)
+#endif
Sound::Sound(Audio::Mixer *mixer, SwordEngine *vm, ResMan *pResMan)
: _rnd("sword1sound") {
@@ -600,7 +604,7 @@ bool Sound::expandSpeech(byte *src, byte *dst, uint32
dstSize, bool *endiannessC
uint8 *fBuf = src;
uint32 headerPos = 0;
- while ((READ_BE_UINT32(fBuf + headerPos) != 'data') && (headerPos
< 100))
+ while ((READ_BE_UINT32(fBuf + headerPos) !=
MKTAG('d','a','t','a')) && (headerPos < 100))
headerPos++;
if (headerPos < 100) {
@@ -849,7 +853,7 @@ void Sound::playSpeech() {
_speechSampleBusy = true;
Audio::SeekableAudioStream *stream = Audio::makeRawStream(
- (byte *)_speechSample, _speechSize, 11025, SPEECH_FLAGS,
DisposeAfterUse::NO);
+ (byte *)_speechSample, _speechSize, 11025, AUDIO_FLAGS,
DisposeAfterUse::NO);
_mixer->playStream(Audio::Mixer::kPlainSoundType, &_hSampleSpeech,
stream);
if (SwordEngine::_systemVars.useWindowsAudioMode) {
@@ -1315,7 +1319,7 @@ void Sound::serveSample(Common::File *file, int32 i)
{
if (_musicStreamFormat[i] != MusWav)
len *= 2;
- _musicOutputStream[i]->queueBuffer(buf, len,
DisposeAfterUse::YES, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN);
+ _musicOutputStream[i]->queueBuffer(buf, len,
DisposeAfterUse::YES, AUDIO_FLAGS);
}
}
}
}}}
...then it seems to unbreak that Vorbis release on big-endian.
But then, it breaks some of the demos which worked before this change.
So this could mean that the problem indeed lies somewhere around the
different file formats/releases we support for this game.
I'll ping Andy in our team to see if we can work from this.
--
Ticket URL: <https://bugs.scummvm.org/ticket/16393#comment:1>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list