Add examples for the high level API.

This commit is contained in:
David Reid
2021-08-14 18:41:26 +10:00
parent eac61ddc52
commit 2671e07560
11 changed files with 1141 additions and 913 deletions
+1 -34
View File
@@ -1,34 +1 @@
/*
This example demonstrates how to initialize an audio engine and play a sound.
This will play the sound specified on the command line.
*/
#define MINIAUDIO_IMPLEMENTATION
#include "../../miniaudio.h"
#include "../miniaudio_engine.h"
int main(int argc, char** argv)
{
ma_result result;
ma_engine engine;
if (argc < 2) {
printf("No input file.");
return -1;
}
result = ma_engine_init(NULL, &engine);
if (result != MA_SUCCESS) {
printf("Failed to initialize audio engine.");
return -1;
}
ma_engine_play_sound(&engine, argv[1], NULL);
printf("Press Enter to quit...");
getchar();
ma_engine_uninit(&engine);
return 0;
}
#include "../../examples/engine_hello_world.c"