aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1/music.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-06-17 14:50:49 +0000
committerTorbjörn Andersson2007-06-17 14:50:49 +0000
commit2a7c76d4e4e2663edeb38cd37262f196bfc7e14f (patch)
tree0ac22f2f1f8d365e747f120e7b3f6ac9cc9e34cd /engines/sword1/music.cpp
parent9666e69d2ab49dd6afb730f7ed9a8003336c7537 (diff)
downloadscummvm-rg350-2a7c76d4e4e2663edeb38cd37262f196bfc7e14f.tar.gz
scummvm-rg350-2a7c76d4e4e2663edeb38cd37262f196bfc7e14f.tar.bz2
scummvm-rg350-2a7c76d4e4e2663edeb38cd37262f196bfc7e14f.zip
Added support for FLAC encoded music in Broken Sword 1. (The compression tool
knows nothing about this, and since they're being rewritten as part of the SoC, I'm not going to do anything about that.) svn-id: r27511
Diffstat (limited to 'engines/sword1/music.cpp')
-rw-r--r--engines/sword1/music.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index 67a390802b..ebff7f9929 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -31,6 +31,7 @@
#include "sword1/music.h"
#include "sound/aiff.h"
+#include "sound/flac.h"
#include "sound/mixer.h"
#include "sound/mp3.h"
#include "sound/vorbis.h"
@@ -201,7 +202,19 @@ int AiffAudioStream::readBuffer(int16 *buffer, const int numSamples) {
bool MusicHandle::play(const char *fileBase, bool loop) {
char fileName[30];
stop();
-
+
+#ifdef USE_FLAC
+ if (!_audioSource) {
+ sprintf(fileName, "%s.flac", fileBase);
+ if (_file.open(fileName))
+ _audioSource = Audio::makeFlacStream(&_file, false, 0, 0, loop ? 0 : 1);
+ }
+ if (!_audioSource) {
+ sprintf(fileName, "%s.fla", fileBase);
+ if (_file.open(fileName))
+ _audioSource = Audio::makeFlacStream(&_file, false, 0, 0, loop ? 0 : 1);
+ }
+#endif
#ifdef USE_VORBIS
if (!_audioSource) {
sprintf(fileName, "%s.ogg", fileBase);