aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur/sound.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2013-12-15 20:11:11 -0500
committerPaul Gilbert2013-12-15 20:11:11 -0500
commit7d8aa0a506ea635a1e60ebef34a704b8d7a24fde (patch)
treeea067435fa3708c60efc1ec8366f4d5c26e54e23 /engines/voyeur/sound.cpp
parente132e8b7c1c99c503a9e369dbe9bb7383fd0c221 (diff)
downloadscummvm-rg350-7d8aa0a506ea635a1e60ebef34a704b8d7a24fde.tar.gz
scummvm-rg350-7d8aa0a506ea635a1e60ebef34a704b8d7a24fde.tar.bz2
scummvm-rg350-7d8aa0a506ea635a1e60ebef34a704b8d7a24fde.zip
VOYEUR: Implemented getVOCFileName
Diffstat (limited to 'engines/voyeur/sound.cpp')
-rw-r--r--engines/voyeur/sound.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/voyeur/sound.cpp b/engines/voyeur/sound.cpp
index 752a35dcc8..ea6f9fa525 100644
--- a/engines/voyeur/sound.cpp
+++ b/engines/voyeur/sound.cpp
@@ -24,6 +24,7 @@
#include "audio/decoders/raw.h"
#include "common/memstream.h"
#include "voyeur/sound.h"
+#include "voyeur/staticres.h"
namespace Voyeur {
@@ -60,11 +61,18 @@ void SoundManager::setVOCOffset(int offset) {
}
Common::String SoundManager::getVOCFileName(int idx) {
- error("TODO: getVOCFileName");
+ return Common::String::format("%s.voc", VOC_FILENAMES[idx]);
}
void SoundManager::startVOCPlay(const Common::String &filename) {
- error("TODO: startVOCPlay");
+ Common::File f;
+ if (!f.open(filename))
+ error("Could not find voc file - %s", filename.c_str());
+
+ Audio::AudioStream *audioStream = Audio::makeVOCStream(f.readStream(f.size()),
+ Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
+
+ _mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, audioStream);
}
int SoundManager::getVOCStatus() {