SA
Skip to main content

Playing Sounds in SDL

Non-looping Sounds

#include <SDL2/SDL.h>
Mix_PlayChannel(-1, game→GetSound("assets/Sounds/SoundName.wav"), 0);

Looping Sounds

Mix_PlayChannel(-1, GetSound("assets/Sounds/Music.ogg"), -1);

Halt Music

Mix_HaltChannel(channel);