aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2005-01-28 11:03:34 +0000
committerPaweł Kołodziejski2005-01-28 11:03:34 +0000
commit730aad6a86f4a509afe50fb324105b389917fb9a (patch)
tree4cec7cd53415e16d4e0d4cb1e4ff3a8ee9004a5a
parenta5a02d3f43bd98b1197515403f75006fe03311c6 (diff)
downloadscummvm-rg350-730aad6a86f4a509afe50fb324105b389917fb9a.tar.gz
scummvm-rg350-730aad6a86f4a509afe50fb324105b389917fb9a.tar.bz2
scummvm-rg350-730aad6a86f4a509afe50fb324105b389917fb9a.zip
added support for mp3 compressed bundles
svn-id: r16656
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index cd91ed4c85..9acc04f3b7 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -23,6 +23,7 @@
#include "common/util.h"
#include "sound/voc.h"
#include "sound/vorbis.h"
+#include "sound/mp3.h"
#include "scumm/scumm.h"
#include "scumm/imuse_digi/dimuse.h"
#include "scumm/imuse_digi/dimuse_sndmgr.h"
@@ -563,12 +564,24 @@ int32 ImuseDigiSndMgr::getDataFromRegion(soundStruct *soundHandle, int region, b
} else if ((soundHandle->bundle) && (soundHandle->compressed)) {
*buf = (byte *)malloc(size);
char fileName[24];
- sprintf(fileName, "%s_reg%03d.ogg", soundHandle->name, region);
+ sprintf(fileName, "%s_reg%03d", soundHandle->name, region);
if (scumm_stricmp(fileName, soundHandle->lastFileName) != 0) {
int32 offs = 0, len = 0;
- File *oggFile = soundHandle->bundle->getFile(fileName, offs, len);
+ File *cmpFile;
+ bool oggMode = false;
+ sprintf(fileName, "%s_reg%03d.mp3", soundHandle->name, region);
+ cmpFile = soundHandle->bundle->getFile(fileName, offs, len);
+ if (!cmpFile) {
+ sprintf(fileName, "%s_reg%03d.ogg", soundHandle->name, region);
+ cmpFile = soundHandle->bundle->getFile(fileName, offs, len);
+ assert(cmpFile);
+ oggMode = true;
+ }
if (!soundHandle->compressedStream) {
- soundHandle->compressedStream = makeVorbisStream(oggFile, len);
+ if (oggMode)
+ soundHandle->compressedStream = makeVorbisStream(cmpFile, len);
+ else
+ soundHandle->compressedStream = makeMP3Stream(cmpFile, len);
assert(soundHandle->compressedStream);
assert(soundHandle->compressedStream->getRate() == 22050);
assert(soundHandle->compressedStream->isStereo());