4 Super Tux - Audio Functions
7 bill@newbreedsoftware.com
8 http://www.newbreedsoftware.com/supertux/
10 April 22, 2000 - December 28, 2003
13 Duong-Khang NGUYEN <neoneurone@users.sf.net>
16 #ifndef SUPERTUX_SOUND_H
17 #define SUPERTUX_SOUND_H
19 #include "defines.h" /* get YES/NO defines */
24 int audio_device; /* != 0: available and initialized */
26 /* enum of different internal music types */
59 static char * soundfilenames[NUM_SOUNDS] = {
60 DATA_PREFIX "/sounds/jump.wav",
61 DATA_PREFIX "/sounds/bigjump.wav",
62 DATA_PREFIX "/sounds/skid.wav",
63 DATA_PREFIX "/sounds/distro.wav",
64 DATA_PREFIX "/sounds/herring.wav",
65 DATA_PREFIX "/sounds/brick.wav",
66 DATA_PREFIX "/sounds/hurt.wav",
67 DATA_PREFIX "/sounds/squish.wav",
68 DATA_PREFIX "/sounds/fall.wav",
69 DATA_PREFIX "/sounds/ricochet.wav",
70 DATA_PREFIX "/sounds/bump-upgrade.wav",
71 DATA_PREFIX "/sounds/upgrade.wav",
72 DATA_PREFIX "/sounds/excellent.wav",
73 DATA_PREFIX "/sounds/coffee.wav",
74 DATA_PREFIX "/sounds/shoot.wav",
75 DATA_PREFIX "/sounds/lifeup.wav",
76 DATA_PREFIX "/sounds/stomp.wav",
77 DATA_PREFIX "/sounds/kick.wav"
83 #include <SDL_mixer.h>
85 /* variables for stocking the sound and music */
86 Mix_Chunk * sounds[NUM_SOUNDS];
87 Mix_Music * level_song, * level_song_fast, * herring_song;
89 /* functions handling the sound and music */
90 int open_audio(int frequency, Uint16 format, int channels, int chunksize);
92 Mix_Chunk * load_sound(char * file);
93 void play_sound(Mix_Chunk * snd);
94 Mix_Music * load_song(char * file);
96 int playing_music(void);
98 int play_music(Mix_Music*music, int loops);
99 void free_music(Mix_Music*music);
100 void free_chunk(Mix_Chunk*chunk);
105 void* sounds[NUM_SOUNDS];
106 void* level_song, *herring_song;
108 // fake sound handlers
109 int open_audio (int frequency, int format, int channels, int chunksize);
111 void* load_sound(void* file);
112 void play_sound(void * snd);
113 void* load_song(void* file);
117 int play_music(void *music, int loops);
118 void free_music(void *music);
120 void free_chunk(void *chunk);
124 #endif /*SUPERTUX_SOUND_H*/