sgdk
|
Z80_DRIVER_DPCM2 sound driver API. More...
Go to the source code of this file.
Defines | |
#define | SND_isPlaying_2ADPCM _Pragma("GCC error \"This method is deprecated, use SND_DPCM2_isPlaying instead.\"") |
#define | SND_startPlay_2ADPCM _Pragma("GCC error \"This method is deprecated, use SND_DPCM2_startPlay instead.\"") |
#define | SND_stopPlay_2ADPCM _Pragma("GCC error \"This method is deprecated, use SND_DPCM2_stopPlay instead.\"") |
Functions | |
void | SND_DPCM2_loadDriver (const bool waitReady) |
Load the Z80_DRIVER_DPCM2 sound driver. | |
void | SND_DPCM2_unloadDriver (void) |
Unload the Z80_DRIVER_DPCM2 sound driver. | |
bool | SND_DPCM2_isPlaying (const u16 channel_mask) |
Return play status of specified channel (2 channels ADPCM player driver). | |
void | SND_DPCM2_startPlay (const u8 *sample, const u32 len, const SoundPCMChannel channel, const bool loop) |
Start playing a sample on specified channel (2 channels ADPCM player driver). If a sample was currently playing on this channel then it's stopped and the new sample is played instead. | |
void | SND_DPCM2_stopPlay (const SoundPCMChannel channel) |
Stop playing the specified channel (2 channels ADPCM player driver). No effect if no sample was currently playing on this channel. |
Z80_DRIVER_DPCM2 sound driver API.
This unit provides playback method for the Z80_DRIVER_DPCM2 sound driver.
Sound driver description:
2 channels 4 bits DPCM sample driver, it can mix up to 2 DCPM samples at a fixed 22050 Hz Khz rate.
Address and size of samples have to be 256 bytes boundary.
Note that SGDK sound drivers may not fit your needs so it's important to know
that some alternatives sound drivers exist (see SGDK readme.md for more info)
Return play status of specified channel (2 channels ADPCM player driver).
channel_mask | Channel(s) we want to retrieve play state. SOUND_PCM_CH1_MSK = channel 1 SOUND_PCM_CH2_MSK = channel 2 You can combine mask to retrieve state of severals channels at once: isPlaying_2ADPCM(SOUND_PCM_CH1_MSK | SOUND_PCM_CH2_MSK) will actually return play state for channel 1 and channel 2. |
void SND_DPCM2_loadDriver | ( | const bool | waitReady | ) |
Load the Z80_DRIVER_DPCM2 sound driver.
Don't use this method directly, use Z80_loadDriver(..) instead.
void SND_DPCM2_startPlay | ( | const u8 * | sample, |
const u32 | len, | ||
const SoundPCMChannel | channel, | ||
const bool | loop | ||
) |
Start playing a sample on specified channel (2 channels ADPCM player driver).
If a sample was currently playing on this channel then it's stopped and the new sample is played instead.
sample | Sample address, should be 128 bytes boundary aligned SGDK automatically align resource as needed |
len | Size of sample in bytes, should be a multiple of 128 SGDK automatically adjust resource size as needed |
channel | Channel where we want to play sample, accepted values are: SOUND_PCM_CH_AUTO = auto selection from current channel usage SOUND_PCM_CH1 = channel 1 SOUND_PCM_CH2 = channel 2 |
loop | Loop flag. If TRUE then the sample will be played in loop (else sample is played only once). |
void SND_DPCM2_stopPlay | ( | const SoundPCMChannel | channel | ) |
Stop playing the specified channel (2 channels ADPCM player driver).
No effect if no sample was currently playing on this channel.
channel | Channel we want to stop, accepted values are: SOUND_PCM_CH1 = channel 1 SOUND_PCM_CH2 = channel 2 |
void SND_DPCM2_unloadDriver | ( | void | ) |
Unload the Z80_DRIVER_DPCM2 sound driver.
Don't use this method directly, use Z80_unloadDriver(..) instead.