diff options
Diffstat (limited to 'src/muxer.cpp')
| -rw-r--r-- | src/muxer.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
| 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) { | |||
| 42 | ERRCHECK(system_->setListenerAttributes(0, &attributes)); | 42 | ERRCHECK(system_->setListenerAttributes(0, &attributes)); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void Muxer::playSound(std::string name) { | ||
| 46 | std::string eventPath = std::string("event:/") + name; | ||
| 47 | |||
| 48 | FMOD::Studio::EventDescription* eventDescription = nullptr; | ||
| 49 | ERRCHECK(system_->getEvent(eventPath.c_str(), &eventDescription)); | ||
| 50 | |||
| 51 | FMOD::Studio::EventInstance* eventInstance = nullptr; | ||
| 52 | ERRCHECK(eventDescription->createInstance(&eventInstance)); | ||
| 53 | ERRCHECK(eventInstance->start()); | ||
| 54 | ERRCHECK(eventInstance->release()); | ||
| 55 | } | ||
| 56 | |||
| 45 | void Muxer::playSoundAtPosition(std::string name, float x, float y) { | 57 | void Muxer::playSoundAtPosition(std::string name, float x, float y) { |
| 46 | std::string eventPath = std::string("event:/") + name; | 58 | std::string eventPath = std::string("event:/") + name; |
| 47 | 59 | ||
