Debian Codegraph @

examples/engine_hello_world.c

raw symbols SCIP
1 /*
2 This example demonstrates how to initialize an audio engine and play a sound.
3
4 This will play the sound specified on the command line.
5 */
6 #include "../miniaudio.c"
7
8 #include <stdio.h>
9
10 int main(int argc, char** argv)
11 {
12 ma_result result;
13 ma_engine engine;
14
15 if (argc < 2) {
16 printf("No input file.");
17 return -1;
18 }
19
20 result = ma_engine_init(NULL, &engine);
21 if (result != MA_SUCCESS) {
22 printf("Failed to initialize audio engine.");
23 return -1;
24 }
25
26 ma_engine_play_sound(&engine, argv[1], NULL);
27
28 printf("Press Enter to quit...");
29 getchar();
30
31 ma_engine_uninit(&engine);
32
33 return 0;
34 }