aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-02-24 23:40:28 +0000
committerMax Horn2007-02-24 23:40:28 +0000
commitb3931a847d21b0770f7b30bd1e4c793dc283abf3 (patch)
tree07d97cf6a807d684f307fd81867f275e1ac89a42
parent65b30d84a805a7b22322474970a219d5628997d5 (diff)
downloadscummvm-rg350-b3931a847d21b0770f7b30bd1e4c793dc283abf3.tar.gz
scummvm-rg350-b3931a847d21b0770f7b30bd1e4c793dc283abf3.tar.bz2
scummvm-rg350-b3931a847d21b0770f7b30bd1e4c793dc283abf3.zip
Trying to unify the order in which we try the various audio formats: Prefer FLAC (lossless) over Ogg Vorbis ('free') over MP3 -- the order is admittedly somewhat arbitrary, but at least now it's consistent across all parts of ScummVM
svn-id: r25837
-rw-r--r--engines/agos/sound.cpp36
-rw-r--r--engines/kyra/sound.cpp12
-rw-r--r--engines/sword1/music.cpp14
-rw-r--r--engines/sword1/sound.cpp16
-rw-r--r--engines/sword2/music.cpp8
-rw-r--r--engines/touche/resource.cpp8
-rw-r--r--sound/audiocd.cpp6
7 files changed, 51 insertions, 49 deletions
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp
index eee2ee540d..b11c130f87 100644
--- a/engines/agos/sound.cpp
+++ b/engines/agos/sound.cpp
@@ -403,23 +403,23 @@ void Sound::loadVoiceFile(const GameSpecificSettings *gss) {
}
}
#endif
-#ifdef USE_MAD
+#ifdef USE_VORBIS
if (!_hasVoiceFile) {
- sprintf(filename, "%s.mp3", gss->speech_filename);
+ sprintf(filename, "%s.ogg", gss->speech_filename);
file->open(filename);
if (file->isOpen()) {
_hasVoiceFile = true;
- _voice = new MP3Sound(_mixer, file);
+ _voice = new VorbisSound(_mixer, file);
}
}
#endif
-#ifdef USE_VORBIS
+#ifdef USE_MAD
if (!_hasVoiceFile) {
- sprintf(filename, "%s.ogg", gss->speech_filename);
+ sprintf(filename, "%s.mp3", gss->speech_filename);
file->open(filename);
if (file->isOpen()) {
_hasVoiceFile = true;
- _voice = new VorbisSound(_mixer, file);
+ _voice = new MP3Sound(_mixer, file);
}
}
#endif
@@ -471,13 +471,13 @@ void Sound::loadSfxFile(const GameSpecificSettings *gss) {
char filename[16];
File *file = new File();
-#ifdef USE_MAD
+#ifdef USE_FLAC
if (!_hasEffectsFile) {
- sprintf(filename, "%s.mp3", gss->effects_filename);
+ sprintf(filename, "%s.fla", gss->effects_filename);
file->open(filename);
if (file->isOpen()) {
_hasEffectsFile = true;
- _effects = new MP3Sound(_mixer, file);
+ _effects = new FlacSound(_mixer, file);
}
}
#endif
@@ -491,13 +491,13 @@ void Sound::loadSfxFile(const GameSpecificSettings *gss) {
}
}
#endif
-#ifdef USE_FLAC
+#ifdef USE_MAD
if (!_hasEffectsFile) {
- sprintf(filename, "%s.fla", gss->effects_filename);
+ sprintf(filename, "%s.mp3", gss->effects_filename);
file->open(filename);
if (file->isOpen()) {
_hasEffectsFile = true;
- _effects = new FlacSound(_mixer, file);
+ _effects = new MP3Sound(_mixer, file);
}
}
#endif
@@ -767,23 +767,23 @@ void Sound::switchVoiceFile(const GameSpecificSettings *gss, uint disc) {
}
}
#endif
-#ifdef USE_MAD
+#ifdef USE_VORBIS
if (!_hasVoiceFile) {
- sprintf(filename, "%s%d.mp3", gss->speech_filename, disc);
+ sprintf(filename, "%s%d.ogg", gss->speech_filename, disc);
file->open(filename);
if (file->isOpen()) {
_hasVoiceFile = true;
- _voice = new MP3Sound(_mixer, file);
+ _voice = new VorbisSound(_mixer, file);
}
}
#endif
-#ifdef USE_VORBIS
+#ifdef USE_MAD
if (!_hasVoiceFile) {
- sprintf(filename, "%s%d.ogg", gss->speech_filename, disc);
+ sprintf(filename, "%s%d.mp3", gss->speech_filename, disc);
file->open(filename);
if (file->isOpen()) {
_hasVoiceFile = true;
- _voice = new VorbisSound(_mixer, file);
+ _voice = new MP3Sound(_mixer, file);
}
}
#endif
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index af5aa5de1f..9463e1e933 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -551,15 +551,15 @@ bool KyraEngine::snd_voiceIsPlaying() {
// static res
const Sound::SpeechCodecs Sound::_supportedCodes[] = {
-#ifdef USE_MAD
- { ".VO3", Audio::makeMP3Stream },
-#endif // USE_MAD
-#ifdef USE_VORBIS
- { ".VOG", Audio::makeVorbisStream },
-#endif // USE_VORBIS
#ifdef USE_FLAC
{ ".VOF", Audio::makeFlacStream },
#endif // USE_FLAC
+#ifdef USE_VORBIS
+ { ".VOG", Audio::makeVorbisStream },
+#endif // USE_VORBIS
+#ifdef USE_MAD
+ { ".VO3", Audio::makeMP3Stream },
+#endif // USE_MAD
{ 0, 0 }
};
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index 6e3a540b8e..333c465705 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -133,18 +133,20 @@ bool MusicHandle::play(const char *fileBase, bool loop) {
char fileName[30];
stop();
_musicMode = MusicNone;
-#ifdef USE_MAD
- sprintf(fileName, "%s.mp3", fileBase);
- if (_file.open(fileName))
- _musicMode = MusicMp3;
-#endif
#ifdef USE_VORBIS
- if (!_file.isOpen()) { // mp3 doesn't exist (or not compiled with MAD support)
+ if (!_file.isOpen()) {
sprintf(fileName, "%s.ogg", fileBase);
if (_file.open(fileName))
_musicMode = MusicVorbis;
}
#endif
+#ifdef USE_MAD
+ if (!_file.isOpen()) {
+ sprintf(fileName, "%s.mp3", fileBase);
+ if (_file.open(fileName))
+ _musicMode = MusicMp3;
+ }
+#endif
if (!_file.isOpen()) {
sprintf(fileName, "%s.wav", fileBase);
if (_file.open(fileName))
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index 42107ae6b1..ce43230f17 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -333,14 +333,6 @@ void Sound::initCowSystem(void) {
/* look for speech1/2.clu in the data dir
and speech/speech.clu (running from cd or using cd layout)
*/
-#ifdef USE_MAD
- sprintf(cowName, "SPEECH%d.CL3", SwordEngine::_systemVars.currentCD);
- _cowFile.open(cowName);
- if (_cowFile.isOpen()) {
- debug(1, "Using MP3 compressed Speech Cluster");
- _cowMode = CowMp3;
- }
-#endif
#ifdef USE_VORBIS
if (!_cowFile.isOpen()) {
sprintf(cowName, "SPEECH%d.CLV", SwordEngine::_systemVars.currentCD);
@@ -351,6 +343,14 @@ void Sound::initCowSystem(void) {
}
}
#endif
+#ifdef USE_MAD
+ sprintf(cowName, "SPEECH%d.CL3", SwordEngine::_systemVars.currentCD);
+ _cowFile.open(cowName);
+ if (_cowFile.isOpen()) {
+ debug(1, "Using MP3 compressed Speech Cluster");
+ _cowMode = CowMp3;
+ }
+#endif
if (!_cowFile.isOpen()) {
sprintf(cowName, "SPEECH%d.CLU", SwordEngine::_systemVars.currentCD);
_cowFile.open(cowName);
diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp
index 7ca7f685d3..dcb1fb9e75 100644
--- a/engines/sword2/music.cpp
+++ b/engines/sword2/music.cpp
@@ -53,14 +53,14 @@ static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base,
const char *ext;
int mode;
} file_types[] = {
- #ifdef USE_MAD
- { "cl3", kMP3Mode },
+ #ifdef USE_FLAC
+ { "clf", kFlacMode },
#endif
#ifdef USE_VORBIS
{ "clg", kVorbisMode },
#endif
- #ifdef USE_FLAC
- { "clf", kFlacMode },
+ #ifdef USE_MAD
+ { "cl3", kMP3Mode },
#endif
{ "clu", kCLUMode }
};
diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp
index 23b5e8afb5..1d57a5b036 100644
--- a/engines/touche/resource.cpp
+++ b/engines/touche/resource.cpp
@@ -45,14 +45,14 @@ struct CompressedSpeechFile {
};
static const CompressedSpeechFile compressedSpeechFilesTable[] = {
-#ifdef USE_MAD
- { "TOUCHE.SO3", Audio::makeMP3Stream },
+#ifdef USE_FLAC
+ { "TOUCHE.SOF", Audio::makeFlacStream },
#endif
#ifdef USE_VORBIS
{ "TOUCHE.SOG", Audio::makeVorbisStream },
#endif
-#ifdef USE_FLAC
- { "TOUCHE.SOF", Audio::makeFlacStream },
+#ifdef USE_MAD
+ { "TOUCHE.SO3", Audio::makeMP3Stream },
#endif
{ 0, 0 }
};
diff --git a/sound/audiocd.cpp b/sound/audiocd.cpp
index 09713eaf0f..44fb35a5ef 100644
--- a/sound/audiocd.cpp
+++ b/sound/audiocd.cpp
@@ -49,15 +49,15 @@ struct TrackFormat {
static const TrackFormat s_trackFormats[] = {
/* decoderName, openTrackFunction */
+#ifdef USE_FLAC
+ { "Flac", getFlacTrack },
+#endif
#ifdef USE_VORBIS
{ "Ogg Vorbis", getVorbisTrack },
#endif
#ifdef USE_MAD
{ "MPEG Layer 3", getMP3Track },
#endif
-#ifdef USE_FLAC
- { "Flac", getFlacTrack },
-#endif
{ NULL, NULL } // Terminator
};