Jo Engine
2024.04.28
Jo Sega Saturn Engine
|
Jo Engine Function prototypes for audio. More...
Go to the source code of this file.
Data Structures | |
struct | jo_sound |
Macros | |
#define | JO_SOUND_MAX_CHANNEL |
#define | JO_DEFAULT_AUDIO_VOLUME |
Default audio volume. More... | |
#define | JO_MAX_AUDIO_VOLUME |
Max audio volume available for jo_audio_set_volume() More... | |
#define | JO_MIN_AUDIO_VOLUME |
Min audio volume available for jo_audio_set_volume() More... | |
Enumerations | |
enum | jo_sound_mode { JoSoundMono8Bit, JoSoundMono16Bit, JoSoundStereo8Bit, JoSoundStereo16Bit } |
Functions | |
void | jo_audio_play_cd_track (const int from_track, const int to_track, const bool repeat_infinitely) |
Play a track from the CD. More... | |
void | jo_audio_set_volume (const unsigned char vol) |
Set the audio volume. More... | |
void | jo_audio_stop_cd (void) |
Stop playing audio track. More... | |
void | jo_audio_play_sound_on_channel (jo_sound *const sound, const unsigned char channel) |
Play a sound on a specific channel. More... | |
void | jo_audio_play_sound (jo_sound *const sound) |
Play a sound on first available channel. More... | |
void | jo_audio_stop_sound (const jo_sound *const sound) |
Stop a sound. More... | |
bool | jo_audio_load_pcm (const char *const filename, const jo_sound_mode mode, jo_sound *sound) |
Load PCM file from CD. More... | |
bool | jo_audio_load_pcm_async (const char *const filename, const jo_sound_mode mode, jo_sound *sound) |
Load PCM file from CD asynchronously. More... | |
void | jo_audio_free_pcm (jo_sound *sound) |
Free pcm sound loaded with jo_audio_load_pcm() More... | |
int | jo_audio_usage_percent (void) |
Get audio channel usage. More... | |
Jo Engine Function prototypes for audio.
struct jo_sound |
Data Fields | ||
---|---|---|
unsigned char | current_playing_channel | |
char * | data | |
unsigned int | data_length | |
jo_sound_mode | mode | |
char | pan | |
unsigned short | sample_rate | |
unsigned char | volume |
#define JO_DEFAULT_AUDIO_VOLUME |
Default audio volume.
#define JO_MAX_AUDIO_VOLUME |
Max audio volume available for jo_audio_set_volume()
#define JO_MIN_AUDIO_VOLUME |
Min audio volume available for jo_audio_set_volume()
#define JO_SOUND_MAX_CHANNEL |
enum jo_sound_mode |
void jo_audio_free_pcm | ( | jo_sound * | sound | ) |
Free pcm sound loaded with jo_audio_load_pcm()
sound | Sound definition |
bool jo_audio_load_pcm | ( | const char *const | filename, |
const jo_sound_mode | mode, | ||
jo_sound * | sound | ||
) |
Load PCM file from CD.
filename | Pcm filename (example: A.PCM) |
mode | PCM audio mode (JoSoundMono16Bit, etc) |
sound | Sound definition (output) |
bool jo_audio_load_pcm_async | ( | const char *const | filename, |
const jo_sound_mode | mode, | ||
jo_sound * | sound | ||
) |
Load PCM file from CD asynchronously.
filename | Pcm filename (example: A.PCM) |
mode | PCM audio mode (JoSoundMono16Bit, etc) |
sound | Sound definition (output) |
void jo_audio_play_cd_track | ( | const int | from_track, |
const int | to_track, | ||
const bool | repeat_infinitely | ||
) |
Play a track from the CD.
from_track | First track index to play |
to_track | Last track index to play |
repeat_infinitely | Play tracks infinitely or not |
void jo_audio_play_sound | ( | jo_sound *const | sound | ) |
Play a sound on first available channel.
sound | Sound definition |
void jo_audio_play_sound_on_channel | ( | jo_sound *const | sound, |
const unsigned char | channel | ||
) |
Play a sound on a specific channel.
sound | Sound definition |
channel | Channel (0 to 6) |
void jo_audio_set_volume | ( | const unsigned char | vol | ) |
Set the audio volume.
vol | Volume level from 0 to 127 |
void jo_audio_stop_cd | ( | void | ) |
Stop playing audio track.
void jo_audio_stop_sound | ( | const jo_sound *const | sound | ) |
Stop a sound.
sound | Sound definition |
int jo_audio_usage_percent | ( | void | ) |
Get audio channel usage.