Manages audio playback for music and sound effects. More...
#include <SDL_mixer.h>#include <stdbool.h>Go to the source code of this file.
Classes | |
| struct | SimpleQueue |
| struct | SoundResources |
| struct | Sound |
Macros | |
| #define | MAX_MUSIC_QUEUE_SIZE 20 |
Typedefs | |
| typedef struct SimpleQueue | SimpleQueue |
| typedef struct SoundResources | SoundResources |
| typedef struct Sound | Sound |
Functions | |
| bool | Sound_System_Initialize () |
| bool | Sound_Load_Resources () |
| void | Sound_Play_Music (const char *path, int loops) |
| [Update] Update Sound_Play_Music to free previous music | |
| void | Sound_Play_Effect (int index) |
| [Utility] Play sound effect | |
| float | Sound_Get_Music_Duration (const char *path) |
| void | Sound_Stop_Music () |
| [Utility] Stop background music | |
| void | Sound_System_Cleanup () |
| [Quit] Clean up sound resources | |
| bool | Sound_Queue_Next_Song (const char *path) |
| [Utility] Queue a single song to play next | |
| void | Sound_Clear_Queue () |
| [Utility] Clear the queued song | |
| void | Music_Finished_Callback () |
| [Callback] Called when music finishes playing Plays the next queued song if available | |
| void | Sound_Set_Max_Channels (int numChannels) |
| Sets the maximum number of sound effect channels. | |
Variables | |
| SoundResources | soundResources |
Manages audio playback for music and sound effects.
The sound system is used to play music and sound effects. It uses SDL_mixer to play the music and sound effects.
| #define MAX_MUSIC_QUEUE_SIZE 20 |
| typedef struct SimpleQueue SimpleQueue |
| typedef struct SoundResources SoundResources |
| enum SoundEffect |
| void Music_Finished_Callback | ( | ) |
[Callback] Called when music finishes playing Plays the next queued song if available
| void Sound_Clear_Queue | ( | ) |
[Utility] Clear the queued song
| float Sound_Get_Music_Duration | ( | const char * | path | ) |
| bool Sound_Load_Resources | ( | ) |
| void Sound_Play_Effect | ( | int | index | ) |
| void Sound_Play_Music | ( | const char * | path, |
| int | loops | ||
| ) |
[Update] Update Sound_Play_Music to free previous music
| bool Sound_Queue_Next_Song | ( | const char * | path | ) |
[Utility] Queue a single song to play next
| path | Path to the music file to play next |
| void Sound_Set_Max_Channels | ( | int | numChannels | ) |
Sets the maximum number of sound effect channels.
| numChannels | The number of channels to allocate. |
| void Sound_Stop_Music | ( | ) |
[Utility] Stop background music
| void Sound_System_Cleanup | ( | ) |
[Quit] Clean up sound resources
| bool Sound_System_Initialize | ( | ) |
|
extern |