[Scummvm-cvs-logs] scummvm master -> 30b554d69407abe82ba92bc956b4b82dd81f8e33

m-kiewitz m_kiewitz at users.sourceforge.net
Sun Jan 3 00:07:34 CET 2016


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:
30b554d694 SCI: sciSound: check compression type


Commit: 30b554d69407abe82ba92bc956b4b82dd81f8e33
    https://github.com/scummvm/scummvm/commit/30b554d69407abe82ba92bc956b4b82dd81f8e33
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-01-03T00:07:05+01:00

Commit Message:
SCI: sciSound: check compression type

Changed paths:
    engines/sci/sound/audio.cpp



diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp
index 7b9a8e0..5d65f5e 100644
--- a/engines/sci/sound/audio.cpp
+++ b/engines/sci/sound/audio.cpp
@@ -105,15 +105,32 @@ void AudioPlayer::handleFanmadeSciAudio(reg_t sciAudioObject, SegManager *segMan
 		else if (fileName.hasPrefix("speech"))
 			soundType = Audio::Mixer::kSpeechSoundType;
 
-		Common::File *sciAudio = new Common::File();
+		// Determine compression
+		// TODO: ".wav" and ".aiff"
+		uint32 audioCompressionType = 0;
+		if ((fileName.hasSuffix(".mp3")) || (fileName.hasSuffix(".sciAudio")) || (fileName.hasSuffix(".sciaudio"))) {
+			audioCompressionType = MKTAG('M','P','3',' ');
+		} else {
+			error("sciAudio: unsupported file type");
+		}
+
+		Common::File *sciAudioFile = new Common::File();
 		// Replace backwards slashes
 		for (uint i = 0; i < fileName.size(); i++) {
 			if (fileName[i] == '\\')
 				fileName.setChar('/', i);
 		}
-		sciAudio->open("sciAudio/" + fileName);
+		sciAudioFile->open("sciAudio/" + fileName);
 
-		Audio::SeekableAudioStream *audioStream = Audio::makeMP3Stream(sciAudio, DisposeAfterUse::YES);
+		Audio::SeekableAudioStream *audioStream = nullptr;
+
+		switch (audioCompressionType) {
+		case MKTAG('M','P','3',' '):
+			audioStream = Audio::makeMP3Stream(sciAudioFile, DisposeAfterUse::YES);
+			break;
+		default:
+			break;
+		}
 
 		// We only support one audio handle
 		_mixer->playStream(soundType, &_audioHandle,






More information about the Scummvm-git-logs mailing list