From 7d8aa0a506ea635a1e60ebef34a704b8d7a24fde Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Dec 2013 20:11:11 -0500 Subject: VOYEUR: Implemented getVOCFileName --- engines/voyeur/sound.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/voyeur/sound.cpp') 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() { -- cgit v1.2.3