aboutsummaryrefslogtreecommitdiff
path: root/src/example/audio_internal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/example/audio_internal.cpp')
-rw-r--r--src/example/audio_internal.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/example/audio_internal.cpp b/src/example/audio_internal.cpp
index e23d485..f3bf349 100644
--- a/src/example/audio_internal.cpp
+++ b/src/example/audio_internal.cpp
@@ -29,15 +29,11 @@ int main() {
SoundContext ctx{};
Sound sound{ctx};
// Load a background track (Ogg Vorbis)
- auto _bgm = sound.clone(Asset{"mwe/audio/bgm.ogg"});
- Sound & bgm = *dynamic_cast<Sound *>(_bgm.get());
+ auto bgm = Sound("mwe/audio/bgm.ogg");
// Load three short samples (WAV)
- auto _sfx1 = sound.clone(Asset{"mwe/audio/sfx1.wav"});
- Sound & sfx1 = *dynamic_cast<Sound *>(_sfx1.get());
- auto _sfx2 = sound.clone(Asset{"mwe/audio/sfx2.wav"});
- Sound & sfx2 = *dynamic_cast<Sound *>(_sfx2.get());
- auto _sfx3 = sound.clone(Asset{"mwe/audio/sfx3.wav"});
- Sound & sfx3 = *dynamic_cast<Sound *>(_sfx3.get());
+ auto sfx1 = Sound("mwe/audio/sfx1.wav");
+ auto sfx2 = Sound("mwe/audio/sfx2.wav");
+ auto sfx3 = Sound("mwe/audio/sfx3.wav");
// Start the background track
bgm.play();