[Scummvm-git-logs] scummvm master -> 681f8f2e40330fe51fafc1145e8c7c16cae4abdd

sev- noreply at scummvm.org
Wed Mar 29 21:52:50 UTC 2023


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

Summary:
681f8f2e40 SLUDGE: Implement .ogg sounds playback


Commit: 681f8f2e40330fe51fafc1145e8c7c16cae4abdd
    https://github.com/scummvm/scummvm/commit/681f8f2e40330fe51fafc1145e8c7c16cae4abdd
Author: iced coke (dallas_march_2019 at outlook.com)
Date: 2023-03-29T23:52:46+02:00

Commit Message:
SLUDGE: Implement .ogg sounds playback

Changed paths:
    engines/sludge/sound.cpp


diff --git a/engines/sludge/sound.cpp b/engines/sludge/sound.cpp
index f03855c540e..46fc53cb91e 100644
--- a/engines/sludge/sound.cpp
+++ b/engines/sludge/sound.cpp
@@ -324,14 +324,26 @@ int SoundManager::makeSoundAudioStream(int f, Audio::AudioStream *&audiostream,
 
 	Common::SeekableReadStream *readStream = g_sludge->_resMan->getData();
 	uint curr_ptr = readStream->pos();
-	Audio::RewindableAudioStream *stream = Audio::makeWAVStream(readStream->readStream(length), DisposeAfterUse::NO);
+		
+	uint32 tag = readStream->readUint32BE();
+	readStream->seek(curr_ptr);
+
+	Audio::RewindableAudioStream *stream = nullptr;
+	if (tag == MKTAG('R', 'I', 'F', 'F')) {
+		stream = Audio::makeWAVStream(readStream->readStream(length), DisposeAfterUse::NO);
+	}
 
 #ifdef USE_VORBIS
-	if (!stream) {
-		readStream->seek(curr_ptr);
+	if (tag == MKTAG('O', 'g', 'g', 'S')) {
 		stream = Audio::makeVorbisStream(readStream->readStream(length), DisposeAfterUse::NO);
-	}
+	} 
 #endif
+
+	if (!stream) {
+		warning("Unsupported sound format");
+		delete stream;
+	}
+
 	g_sludge->_resMan->finishAccess();
 
 	if (stream) {




More information about the Scummvm-git-logs mailing list