summaryrefslogtreecommitdiffhomepage
path: root/examples/others/audio_standalone.c
diff options
context:
space:
mode:
authorDavid Reid <[email protected]>2018-04-21 17:26:40 +1000
committerDavid Reid <[email protected]>2018-04-21 17:26:40 +1000
commitf5ebbfb6bc80e5d5555e84ee505ff794c2bc64b6 (patch)
tree800aeb61be9c2018d1a048da54d1f6ab746f11f1 /examples/others/audio_standalone.c
parent950f31e620a9239dc91230ad92bb243f149e6f2c (diff)
parent847bdaf68287f70fbeb5599361257b6f982e48c5 (diff)
downloadraylib-f5ebbfb6bc80e5d5555e84ee505ff794c2bc64b6.tar.gz
raylib-f5ebbfb6bc80e5d5555e84ee505ff794c2bc64b6.zip
Merge branch 'master' of https://github.com/raysan5/raylib into dr/mini_al
Diffstat (limited to 'examples/others/audio_standalone.c')
-rw-r--r--examples/others/audio_standalone.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/examples/others/audio_standalone.c b/examples/others/audio_standalone.c
index 0a09c988..38fe9935 100644
--- a/examples/others/audio_standalone.c
+++ b/examples/others/audio_standalone.c
@@ -26,14 +26,11 @@
********************************************************************************************/
#include <stdio.h>
+#include "audio.h"
#if defined(_WIN32)
#include <conio.h> // Windows only, no stardard library
-#endif
-
-#include "audio.h"
-
-#if defined(__linux__)
+#else
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
@@ -79,13 +76,13 @@ int main()
{
// Initialization
//--------------------------------------------------------------------------------------
- unsigned char key;
-
+ static unsigned char key;
+
InitAudioDevice();
-
+
Sound fxWav = LoadSound("resources/audio/weird.wav"); // Load WAV audio file
Sound fxOgg = LoadSound("resources/audio/tanatana.ogg"); // Load OGG audio file
-
+
Music music = LoadMusicStream("resources/audio/guitar_noodling.ogg");
PlayMusicStream(music);
@@ -102,23 +99,23 @@ int main()
PlaySound(fxWav);
key = 0;
}
-
+
if (key == 'd')
{
PlaySound(fxOgg);
key = 0;
}
-
+
UpdateMusicStream(music);
}
-
+
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadSound(fxWav); // Unload sound data
UnloadSound(fxOgg); // Unload sound data
-
+
UnloadMusicStream(music); // Unload music stream data
-
+
CloseAudioDevice();
//--------------------------------------------------------------------------------------