26#ifndef __DC_SOUND_SFXMGR_H
27#define __DC_SOUND_SFXMGR_H
55#define SFXHND_INVALID 0
62typedef struct sfx_play_data {
Virtual filesystem support.
int snd_sfx_play_ex(sfx_play_data_t *data)
Extended sound effect playback function.
void snd_sfx_chn_free(int chn)
Free a previously allocated channel.
sfxhnd_t snd_sfx_load_fd(file_t fd, size_t len, uint32_t rate, uint16_t bitsize, uint16_t channels)
Load a sound effect without wav header by file handler.
void snd_sfx_stop(int chn)
Stop a single channel of sound.
int snd_sfx_play_chn(int chn, sfxhnd_t idx, int vol, int pan)
Play a sound effect on a specific channel.
int snd_sfx_play(sfxhnd_t idx, int vol, int pan)
Play a sound effect.
uint32_t sfxhnd_t
Sound effect handle type.
Definition sfxmgr.h:48
int snd_sfx_chn_alloc(void)
Allocate a sound channel for use outside the sound effect system.
void snd_sfx_stop_all(void)
Stop all channels playing sound effects.
sfxhnd_t snd_sfx_load_buf(char *buf)
Load a sound effect.
void snd_sfx_unload_all(void)
Unload all loaded sound effects.
sfxhnd_t snd_sfx_load_ex(const char *fn, uint32_t rate, uint16_t bitsize, uint16_t channels)
Load a sound effect without wav header.
sfxhnd_t snd_sfx_load_raw_buf(char *buf, size_t len, uint32_t rate, uint16_t bitsize, uint16_t channels)
Load a sound effect without wav header from buffer.
sfxhnd_t snd_sfx_load(const char *fn)
Load a sound effect.
void snd_sfx_unload(sfxhnd_t idx)
Unload a sound effect.
int file_t
File descriptor type.
Definition fs.h:94
Data structure for sound effect playback.
Definition sfxmgr.h:62
int loop
Whether to loop the sound effect or not.
Definition sfxmgr.h:70
unsigned int loopstart
Loop start index (in samples).
Definition sfxmgr.h:72
int pan
The panning value of the sound effect.
Definition sfxmgr.h:67
unsigned int loopend
Loop end index (in samples).
Definition sfxmgr.h:73
int freq
Frequency.
Definition sfxmgr.h:71
int chn
The channel to play on.
Definition sfxmgr.h:63
sfxhnd_t idx
The handle to the sound effect to play.
Definition sfxmgr.h:65
int vol
The volume to play at (between 0 and 255).
Definition sfxmgr.h:66