diff options
Diffstat (limited to 'src/dummy_audio.cpp')
-rw-r--r-- | src/dummy_audio.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/dummy_audio.cpp b/src/dummy_audio.cpp index fb1e3ab..1249076 100644 --- a/src/dummy_audio.cpp +++ b/src/dummy_audio.cpp @@ -1,5 +1,5 @@ -#include "crepe/SoundSystem.h" #include "crepe/util/log.h" +#include "crepe/Sound.h" #include <chrono> #include <thread> @@ -7,32 +7,33 @@ using namespace crepe; using namespace std; using namespace std::chrono_literals; +using std::make_unique; int main() { dbg_trace(); - auto bgm = SoundSystem::sound("../mwe/audio/bgm.ogg"); - auto sfx1 = SoundSystem::sound("../mwe/audio/sfx1.wav"); - auto sfx2 = SoundSystem::sound("../mwe/audio/sfx2.wav"); - auto sfx3 = SoundSystem::sound("../mwe/audio/sfx3.wav"); + auto bgm = Sound("../mwe/audio/bgm.ogg"); + auto sfx1 = Sound("../mwe/audio/sfx1.wav"); + auto sfx2 = Sound("../mwe/audio/sfx2.wav"); + auto sfx3 = Sound("../mwe/audio/sfx3.wav"); - bgm->play(); + bgm.play(); // play each sample sequentially this_thread::sleep_for(500ms); - sfx1->play(); + sfx1.play(); this_thread::sleep_for(500ms); - sfx2->play(); - bgm->pause(); + sfx2.play(); + bgm.pause(); this_thread::sleep_for(500ms); - sfx3->play(); - bgm->play(); + sfx3.play(); + bgm.play(); this_thread::sleep_for(500ms); // play all samples simultaniously - sfx1->play(); - sfx2->play(); - sfx3->play(); + sfx1.play(); + sfx2.play(); + sfx3.play(); this_thread::sleep_for(1000ms); return 0; |