3#include <SDL3_mixer/SDL_mixer.h>
9 const int channel = Mix_GroupAvailable(0);
10 Mix_VolumeChunk(sample.get(), volume);
11 Mix_SetPanning(channel, pan, 255 - pan);
12 Mix_PlayChannel(-1, sample.get(), loop);
16 Mix_VolumeMusic(volume);
17 Mix_PlayMusic(sample.get(), -1);
void play(const asw::Sample &sample, int volume=255, unsigned char pan=128, int loop=0)
Play a sample.
void stopMusic()
Stop the currently playing music.
void playMusic(const asw::Music &sample, int volume=255)
Play a music sample.
std::shared_ptr< Mix_Chunk > Sample
Alias for a shared pointer to an Mix_Chunk.
std::shared_ptr< Mix_Music > Music
Alias for a shared pointer to an Mix_Music.
Sound module for the ASW library.