PCM playback.
#include <srl_sound.hpp>
Classes | |
class | IPcmFile |
Base PCM file interface. More... | |
class | RawPcm |
Raw PCM sound. More... | |
class | WaveSound |
Wave sound effect. More... | |
Public Types | |
enum | PcmBitDepth { Pcm8Bit = _PCM8Bit , Pcm16Bit = _PCM16Bit } |
PCM audio bit depth. More... | |
enum | PcmChannels { Mono = _Mono , Stereo = _Stereo } |
PCM audio channels. More... | |
enum | PcmMalloc : uint16_t { Default = 0 , HwRam = 1 , LwRam = 2 , CartRam = 3 } |
Malloc types to use for loading PCM. More... | |
Static Public Member Functions | |
static bool | IsChannelFree (uint8_t channel) |
Check whether sound channel is currently free. | |
static int8_t | Play (Pcm::IPcmFile &pcm, uint8_t volume=127, int8_t pan=0) |
Try to play sound on the first free channel. | |
static bool | PlayOnChannel (Pcm::IPcmFile &pcm, uint8_t channel, uint8_t volume=127, int8_t pan=0) |
Try to play a sound on a specific channel. | |
static void | SetMemAllocationBehaviour (const Pcm::PcmMalloc work, const Pcm::PcmMalloc data) |
Set the Mem Allocation Behaviour for loading PCM files. | |
static void | SetVolumePan (uint8_t channel, uint8_t volume, int8_t pan=0) |
Set the Volume & Panning. | |
static bool | StopSound (uint8_t channel) |
Stop currently playing sound. | |
enum SRL::Sound::Pcm::PcmMalloc : uint16_t |
|
inlinestatic |
Check whether sound channel is currently free.
channel | Sound channel to check (0-3) |
|
inlinestatic |
Try to play sound on the first free channel.
pcm | Sound effect to play |
volume | Playback volume (0-127) |
pan | Audio channel panning (-127 to 127) |
|
inlinestatic |
|
inlinestatic |
Set the Mem Allocation Behaviour for loading PCM files.
work | This malloc will be used to allocate memory for parsing a file |
data | This malloc will be used to allocate memory for a parsed file |
|
inlinestatic |
Set the Volume & Panning.
channel | Sound channel to modify (0-3) |
volume | Playback volume (0-127) |
pan | Audio channel panning (-127 to 127) |
|
inlinestatic |
Stop currently playing sound.
channel | Sound channel to stop (0-3) |