libmsx
C library for MSX
Loading...
Searching...
No Matches
snddrv.h
Go to the documentation of this file.
1// -*- coding: utf-8-unix -*-
2/*
3 * Copyright (c) 2021-2024 Daishi Mori (mori0091)
4 *
5 * This software is released under the MIT License.\n
6 * See https://github.com/mori0091/libmsx/blob/main/LICENSE
7 *
8 * GitHub libmsx project\n
9 * https://github.com/mori0091/libmsx
10 */
45#ifndef SNDDRV_H_
46#define SNDDRV_H_
47
48#include <audio.h>
49#include <audio_dec.h>
50
51#include "./snd_sound.h"
52#include <stdint.h>
53
65#define SND_SPEED_1X (16)
66
67extern const AudioDecoder SND_BGM_DECODER;
68extern const AudioDecoder SND_SFX_DECODER;
69
79
89
105void snd_set_player_frequency(uint8_t freq);
106
128void snd_set_speed(uint8_t multiplier);
129
138void snd_set_repeat(bool repeat);
139
146void snd_set_bgm(uint8_t index, const snd_SoundAssets * sa);
147
157void snd_set_sfx(uint8_t index, const snd_SoundAssets * sa);
158
170void snd_set_sfx_with_priority(uint8_t index, const snd_SoundAssets * sa, uint8_t priority);
171
180bool snd_is_playing(void);
181
191
201
208void snd_init(void);
209
216void snd_start(void);
217
224void snd_pause(void);
225
232bool snd_is_paused(void);
233
240void snd_stop(void);
241
248void snd_play(void);
249
252#endif // SNDDRV_H_
The libmsx audio replayer.
The audio decoder interface for the libmsx audio replayer.
void snd_set_sfx(uint8_t index, const snd_SoundAssets *sa)
MSX Sets the specified music as SFX (sound effects) in the sound driver.
void snd_start(void)
MSX Start / Resume music.
void snd_init(void)
MSX Initialize the PSG and the sound driver.
const AudioDecoder SND_SFX_DECODER
uint8_t snd_get_player_frequency(void)
MSX Returns current player frequency of the background music.
bool snd_is_playing(void)
MSX Return whether BGM and/or SFX is playing or not.
void snd_stop(void)
MSX Stop music.
void snd_set_speed(uint8_t multiplier)
MSX Sets the playback speed multiplier for background music.
void snd_set_sfx_with_priority(uint8_t index, const snd_SoundAssets *sa, uint8_t priority)
MSX Sets the specified music as SFX (sound effects) in the sound driver.
void snd_pause(void)
MSX Pause music.
const AudioDecoder SND_BGM_DECODER
void snd_play(void)
MSX Main routine of the sound driver.
bool snd_is_playing_bgm(void)
MSX Return whether BGM is playing or not.
void snd_set_bgm(uint8_t index, const snd_SoundAssets *sa)
MSX Sets the specified music as BGM in the sound driver.
void snd_set_player_frequency(uint8_t freq)
MSX Force player frequency of the background music.
uint8_t snd_get_bgm_frequency(void)
MSX Returns default frequency of the background music.
void snd_set_repeat(bool repeat)
MSX Turn on/off the auto-repeat of the BGM.
bool snd_is_playing_sfx(void)
MSX Return whether SFX is playing or not.
bool snd_is_paused(void)
MSX Return whether paused or not.
Container of list of musics, instruments, arpeggio tables, and period tables.
Definition snd_sound.h:117
Sound / Music data structure for snddrv.
The audio decoder interface.
Definition audio_dec.h:89