36# define __JO_AUDIO_H__
38#ifdef JO_COMPILE_WITH_AUDIO_SUPPORT
41# define JO_SOUND_MAX_CHANNEL (14)
65# define JO_DEFAULT_AUDIO_VOLUME (127)
67# define JO_MAX_AUDIO_VOLUME (127)
69# define JO_MIN_AUDIO_VOLUME (0)
71#ifdef JO_COMPILE_WITH_FS_SUPPORT
122# define JO_AUDIO_CD_VOLUME_MAX (7)
169#ifdef JO_COMPILE_WITH_AUDIO_DSP_SUPPORT
174 unsigned short decay_ms;
175 unsigned char damping;
186void jo_audio_set_reverb(
const jo_audio_reverb *
const reverb);
190#ifdef JO_COMPILE_WITH_AUDIO_DRIVER_SUPPORT
202 unsigned short frequency;
203 unsigned short end_frequency;
204 unsigned short glide_ms;
205 unsigned short decay_ms;
206 unsigned char volume;
208 unsigned char reverb;
209 unsigned char modulation;
210 unsigned char modulator_ratio;
211 unsigned char tremolo;
212 unsigned char tremolo_rate;
213 jo_tone_waveform waveform;
223void jo_audio_play_tone(
const jo_audio_tone *
const tone,
const unsigned char channel);
244#ifdef JO_COMPILE_WITH_FS_SUPPORT
void jo_audio_free_resident(void)
Forget all the resident sounds (a new level): their room in the sound RAM is free again.
void jo_audio_play_cd_track(const int from_track, const int to_track, const bool repeat_infinitely)
Play a track from the CD.
void jo_audio_stop_channel(const unsigned char channel)
Stop the sound played on a channel.
jo_sound_mode mode
Definition audio.h:55
jo_sound_mode
Definition audio.h:44
@ JoSoundStereo16Bit
Definition audio.h:48
@ JoSoundMono8Bit
Definition audio.h:45
@ JoSoundStereo8Bit
Definition audio.h:47
@ JoSoundMono16Bit
Definition audio.h:46
bool jo_audio_load_pcm_async(const char *const filename, const jo_sound_mode mode, jo_sound *sound)
Load PCM file from CD asynchronously.
bool jo_audio_load_pcm(const char *const filename, const jo_sound_mode mode, jo_sound *sound)
Load PCM file from CD.
void jo_audio_set_channel_volume(const unsigned char channel, const unsigned char volume)
Change the volume of the sound played on a channel.
void jo_audio_set_cd_volume(const unsigned char level)
Set the level of the CD audio in the mix (the music tracks of the CD, see jo_audio_play_cd_track()).
unsigned char reverb
Definition audio.h:61
unsigned int resident
Definition audio.h:60
void jo_audio_free_pcm(jo_sound *sound)
Free pcm sound loaded with jo_audio_load_pcm().
bool jo_audio_is_cd_paused(void)
Check if the CD audio is paused (see jo_audio_pause_cd()).
void jo_audio_set_channel_reverb(const unsigned char channel, const unsigned char level)
Change the send of the sound played on a channel to the reverberation (JO_COMPILE_WITH_AUDIO_DSP_MODU...
int jo_audio_usage_percent(void)
Get audio channel usage.
bool jo_audio_is_cd_playing(void)
Check if the CD drive is playing.
unsigned int data_length
Definition audio.h:54
void jo_audio_set_volume(const unsigned char vol)
Set the audio volume.
void jo_audio_play_sound(jo_sound *const sound)
Play a sound on first available channel.
void jo_audio_pause_cd(void)
Pause the audio track played by jo_audio_play_cd_track().
char * data
Definition audio.h:53
void jo_audio_play_sound_on_channel(jo_sound *const sound, const unsigned char channel)
Play a sound on a specific channel.
bool jo_audio_is_channel_playing(const unsigned char channel)
Checks whether a given audio channel is currently playing a sound.
void jo_audio_stop_sound(const jo_sound *const sound)
Stop a sound.
void jo_audio_set_channel_sample_rate(const unsigned char channel, const unsigned short sample_rate)
Change the sampling rate of the sound played on a channel (its pitch: a faster engine for instance).
char pan
Definition audio.h:59
unsigned char current_playing_channel
Definition audio.h:56
void jo_audio_play_sound_loop_on_channel(jo_sound *const sound, const unsigned char channel)
Play a sound again and again on a specific channel, until the channel is stopped (an engine for insta...
unsigned char volume
Definition audio.h:58
void jo_audio_resume_cd(void)
Resume the audio track paused by jo_audio_pause_cd().
void jo_audio_stop_cd(void)
Stop playing audio track.
bool jo_audio_load_wav(const char *const filename, jo_sound *sound)
Load a WAV file from CD (PCM, 8 or 16 bits, mono or stereo, any sample rate: the sound gets its mode ...
bool jo_audio_make_resident(jo_sound *sound)
Keep a sound in the sound RAM (512 KB) and free its copy in the work RAM (the jo_malloc() memory).
unsigned short sample_rate
Definition audio.h:57