ASCII-GFX  2.0
sound.h
Go to the documentation of this file.
1 // SDL sound for NCurses
2 // (c) 2020 by Stefan Roettger
3 
4 #pragma once
5 
6 #include <stdlib.h> // for NULL
7 
9 bool sound_init();
10 
12 bool sound_detected();
13 
15 void configure_sound(bool yes);
16 
20 int sound_play(const char *filename, float volume = 1,
21  const char *altpath = NULL);
22 
24 bool sound_playing(int channel);
25 
29 void sound_stop(int channel = -1);
30 
32 void sound_mute(bool yes = true);
33 
35 void sound_exit();
sound_exit
void sound_exit()
exit SDL
Definition: sound.cpp:196
sound_init
bool sound_init()
init SDL
Definition: sound.cpp:24
sound_stop
void sound_stop(int channel=-1)
stop playing a sound channel
Definition: sound.cpp:157
configure_sound
void configure_sound(bool yes)
enable or disable all sound channels
Definition: sound.cpp:70
sound_playing
bool sound_playing(int channel)
check if a sound channel is still playing
Definition: sound.cpp:142
sound_mute
void sound_mute(bool yes=true)
mute all sound channels
Definition: sound.cpp:183
sound_play
int sound_play(const char *filename, float volume=1, const char *altpath=NULL)
play WAV file with SDL
Definition: sound.cpp:78
sound_detected
bool sound_detected()
sound detected
Definition: sound.cpp:60