diff examples/example-audio/main.c @ 364:570ab19bf268

misc: start removing adventure from library
author David Demelier <markand@malikania.fr>
date Sun, 24 Oct 2021 11:29:04 +0200
parents cd8b87ddd1e7
children 19782ea1cf4a
line wrap: on
line diff
--- a/examples/example-audio/main.c	Sun Oct 24 09:55:12 2021 +0200
+++ b/examples/example-audio/main.c	Sun Oct 24 11:29:04 2021 +0200
@@ -32,9 +32,11 @@
 #include <ui/theme.h>
 #include <ui/ui.h>
 
+#include <assets/music/vabsounds-romance.h>
+#include <assets/sounds/fire.h>
+
 #define W       1280
 #define H       720
-#define PATH(r) util_pathf("%s/%s", sys_dir(SYS_DIR_DATA), r)
 
 static struct music music;
 static struct sound sound;
@@ -60,8 +62,8 @@
 		panic();
 	if (window_open("Example - Audio", W, H) < 0)
 		panic();
-	if (music_open(&music, PATH("music/vabsounds-romance.ogg")) < 0 ||
-	    sound_open(&sound, PATH("sounds/fire.wav")) < 0)
+	if (music_openmem(&music, assets_music_vabsounds_romance, sizeof (assets_music_vabsounds_romance)) < 0 ||
+	    sound_openmem(&sound, assets_sounds_fire, sizeof (assets_sounds_fire)) < 0)
 		panic();
 }