[Scummvm-cvs-logs] SF.net SVN: scummvm: [27721] scummvm/trunk

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Tue Jun 26 05:08:04 CEST 2007


Revision: 27721
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27721&view=rev
Author:   Kirben
Date:     2007-06-25 20:08:03 -0700 (Mon, 25 Jun 2007)

Log Message:
-----------
Add FLAC support for speech in Broken Sword 1.

Modified Paths:
--------------
    scummvm/trunk/README
    scummvm/trunk/engines/sword1/sound.cpp
    scummvm/trunk/engines/sword1/sound.h

Modified: scummvm/trunk/README
===================================================================
--- scummvm/trunk/README	2007-06-26 03:07:18 UTC (rev 27720)
+++ scummvm/trunk/README	2007-06-26 03:08:03 UTC (rev 27721)
@@ -1422,6 +1422,9 @@
 Running "compress_sword1 --vorbis" will compress the files using Ogg Vorbis
 instead of MP3.
 
+Running "compress_sword1 --flac" will compress the files using Flac
+instead of MP3.
+
 Use "compress_sword1 --help" to get a full list of the options.
 
 

Modified: scummvm/trunk/engines/sword1/sound.cpp
===================================================================
--- scummvm/trunk/engines/sword1/sound.cpp	2007-06-26 03:07:18 UTC (rev 27720)
+++ scummvm/trunk/engines/sword1/sound.cpp	2007-06-26 03:08:03 UTC (rev 27721)
@@ -197,8 +197,8 @@
 			if (data)
 				_mixer->playRaw(Audio::Mixer::kSpeechSoundType, &_speechHandle, data, size, 11025, SPEECH_FLAGS, SOUND_SPEECH_ID, speechVol, speechPan);
 		}
-#ifdef USE_MAD
-		else if (_cowMode == CowMp3) {
+#ifdef USE_FLAC
+		else if (_cowMode == CowFlac) {
 			_cowFile.seek(index);
 			_mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, Audio::makeMP3Stream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
 			// with compressed audio, we can't calculate the wave volume.
@@ -212,11 +212,24 @@
 		else if (_cowMode == CowVorbis) {
 			_cowFile.seek(index);
 			_mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, Audio::makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
+			// with compressed audio, we can't calculate the wave volume.
+			// so default to talking.
 			for (int cnt = 0; cnt < 480; cnt++)
 				_waveVolume[cnt] = true;
 			_waveVolPos = 0;
 		}
 #endif
+#ifdef USE_MAD
+		else if (_cowMode == CowMp3) {
+			_cowFile.seek(index);
+			_mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, Audio::makeMP3Stream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
+			// with compressed audio, we can't calculate the wave volume.
+			// so default to talking.
+			for (int cnt = 0; cnt < 480; cnt++)
+				_waveVolume[cnt] = true;
+			_waveVolPos = 0;
+		}
+#endif
 		return true;
 	} else
 		return false;
@@ -332,6 +345,16 @@
 	/* look for speech1/2.clu in the data dir
 	   and speech/speech.clu (running from cd or using cd layout)
 	*/
+#ifdef USE_FLAC
+	if (!_cowFile.isOpen()) {
+		sprintf(cowName, "SPEECH%d.CLF", SwordEngine::_systemVars.currentCD);
+		_cowFile.open(cowName);
+		if (_cowFile.isOpen()) {
+			debug(1, "Using Vorbis compressed Speech Cluster");
+			_cowMode = CowFlac;
+		}
+	}
+#endif
 #ifdef USE_VORBIS
 	if (!_cowFile.isOpen()) {
 		sprintf(cowName, "SPEECH%d.CLV", SwordEngine::_systemVars.currentCD);

Modified: scummvm/trunk/engines/sword1/sound.h
===================================================================
--- scummvm/trunk/engines/sword1/sound.h	2007-06-26 03:07:18 UTC (rev 27720)
+++ scummvm/trunk/engines/sword1/sound.h	2007-06-26 03:08:03 UTC (rev 27721)
@@ -66,8 +66,9 @@
 
 enum CowMode {
 	CowWave = 0,
+	CowFlac,
+	CowVorbis,
 	CowMp3,
-	CowVorbis,
 	CowDemo
 };
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list