From 2c75d95ddf849996bfc18267a9eecb4d0f4e1916 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 16 Mar 2022 15:30:37 -0400 Subject: signs can be read now! --- src/muxer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/muxer.cpp') diff --git a/src/muxer.cpp b/src/muxer.cpp index 3450187..c93c45a 100644 --- a/src/muxer.cpp +++ b/src/muxer.cpp @@ -42,6 +42,18 @@ void Muxer::setPlayerLoc(int x, int y) { ERRCHECK(system_->setListenerAttributes(0, &attributes)); } +void Muxer::playSound(std::string name) { + std::string eventPath = std::string("event:/") + name; + + FMOD::Studio::EventDescription* eventDescription = nullptr; + ERRCHECK(system_->getEvent(eventPath.c_str(), &eventDescription)); + + FMOD::Studio::EventInstance* eventInstance = nullptr; + ERRCHECK(eventDescription->createInstance(&eventInstance)); + ERRCHECK(eventInstance->start()); + ERRCHECK(eventInstance->release()); +} + void Muxer::playSoundAtPosition(std::string name, float x, float y) { std::string eventPath = std::string("event:/") + name; -- cgit 1.4.1