ASCII-GFX  2.0
Functions
sound.cpp File Reference
#include "sound.h"
#include <string.h>

Functions

unsigned int hash_func (const char *s)
 
bool sound_init ()
 init SDL More...
 
bool sound_detected ()
 sound detected More...
 
void configure_sound (bool yes)
 enable or disable all sound channels More...
 
int sound_play (const char *filename, float volume, const char *altpath)
 play WAV file with SDL More...
 
bool sound_playing (int channel)
 check if a sound channel is still playing More...
 
void sound_stop (int channel)
 stop playing a sound channel More...
 
void sound_mute (bool yes)
 mute all sound channels More...
 
void sound_exit ()
 exit SDL More...
 

Function Documentation

◆ configure_sound()

void configure_sound ( bool  yes)

enable or disable all sound channels

◆ hash_func()

unsigned int hash_func ( const char *  s)

◆ sound_detected()

bool sound_detected ( )

sound detected

◆ sound_exit()

void sound_exit ( )

exit SDL

◆ sound_init()

bool sound_init ( )

init SDL

◆ sound_mute()

void sound_mute ( bool  yes)

mute all sound channels

◆ sound_play()

int sound_play ( const char *  filename,
float  volume = 1,
const char *  altpath = NULL 
)

play WAV file with SDL

  • sound volume is specified int the range [0,1]
  • returns the playing sound channel

◆ sound_playing()

bool sound_playing ( int  channel)

check if a sound channel is still playing

◆ sound_stop()

void sound_stop ( int  channel = -1)

stop playing a sound channel

  • by default all sound channels are stopped
  • if provided a channel only that channel is stopped