audio&island
[carveJwlIkooP6JGAAIwe30JlM.git] / audio.h
1 #ifndef AUDIO_H
2 #define AUDIO_H
3
4 #include "common.h"
5
6 sfx_vol_control audio_vol_all = { .val = 1.0f, .name = "All" };
7
8 sfx_set audio_board =
9 {
10 .sources = "sound/skate.ogg\0"
11 "sound/wheel.ogg\0"
12 "sound/slide.ogg\0"
13 };
14
15 sfx_system audio_player0 =
16 {
17 .vol = 0.0f,
18 .ch = 1,
19 .vol_src = &audio_vol_all,
20 .name = "Player0",
21 .flags = SFX_FLAG_REPEAT | SFX_FLAG_PERSISTENT
22 };
23
24 sfx_system audio_player1 =
25 {
26 .vol = 0.0f,
27 .ch = 1,
28 .vol_src = &audio_vol_all,
29 .name = "Player1",
30 .flags = SFX_FLAG_REPEAT | SFX_FLAG_PERSISTENT
31 };
32
33 sfx_system audio_player2 =
34 {
35 .vol = 0.0f,
36 .ch = 1,
37 .vol_src = &audio_vol_all,
38 .name = "Player2",
39 .flags = SFX_FLAG_REPEAT | SFX_FLAG_PERSISTENT
40 };
41
42 static void audio_init(void)
43 {
44 sfx_set_init( &audio_board, NULL );
45 sfx_set_play( &audio_board, &audio_player0, 0 );
46 sfx_set_play( &audio_board, &audio_player1, 1 );
47 sfx_set_play( &audio_board, &audio_player2, 2 );
48 }
49
50 static void audio_free(void)
51 {
52 sfx_set_free( &audio_board );
53 }
54
55 #endif /* AUDIO_H */