Sound system implementation. More...
#include <sound.h>#include <stdio.h>#include <SDL_mixer.h>#include <stdlib.h>#include <string.h>#include <SDL.h>Functions | |
| void | Sound_Set_Max_Channels (int numChannels) |
| Sets the maximum number of sound effect channels. | |
| bool | Sound_System_Initialize () |
| bool | Sound_Load_Resources () |
| 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 | |
| void | Music_Finished_Callback () |
| [Callback] Called when music finishes playing Plays the next queued song if available | |
| 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 | Sound_Play_Music (const char *path, int loops) |
| [Update] Update Sound_Play_Music to free previous music | |
Variables | |
| SoundResources | soundResources |
| SimpleQueue | musicQueue |
Sound system implementation.
Manages the game's audio resources, including sound effects, music playback, and volume controls.
| 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 | ( | ) |
| SimpleQueue musicQueue |
| SoundResources soundResources |