|
sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
|
Mixer channels 0 to 23 that play sounds. More...
Functions | |
| int | audio_channel_play_sound (int channel, audio_sound_t sound) |
| int | audio_play_sound (audio_sound_t sound) |
| int | audio_channel_stop (int channel) |
| int | audio_channel_is_playing (int channel) |
| int | audio_channel_get_playing_sound (int channel, audio_sound_t *sound_out) |
| int | audio_channel_set_volume (int channel, int volume_percent) |
| int | audio_channel_set_volume_and_pan (int channel, int volume_percent, int pan) |
| int | audio_channel_set_pitch (int channel, float ratio) |
Mixer channels 0 to 23 that play sounds.
A channel keeps its volume, pan and pitch until they are changed, including across sounds and before the first sound plays. Commands that return AUDIO_OK without a reply from the driver (play, stop and the volume, pan and pitch setters) are validated by the library, sent, and executed by the driver in the order they were sent; a later call such as audio_channel_is_playing() sees their effect.
| int audio_channel_get_playing_sound | ( | int | channel, |
| audio_sound_t * | sound_out ) |
The sound playing on a channel.
| channel | 0 to 23. | |
| [out] | sound_out | Receives the handle, or AUDIO_SOUND_INVALID when the channel is idle. |
| int audio_channel_is_playing | ( | int | channel | ) |
Whether a channel is playing. A sound that finished counts as not playing.
| channel | 0 to 23. |
| int audio_channel_play_sound | ( | int | channel, |
| audio_sound_t | sound ) |
Plays a sound on a channel, replacing whatever was playing there. The channel keeps its volume, pan and pitch.
| channel | 0 to 23. |
| sound | A handle from a load function. |
| int audio_channel_set_pitch | ( | int | channel, |
| float | ratio ) |
Sets the playback speed as a ratio of the sound's own rate. Applies at once to a playing sound and persists.
| channel | 0 to 23. |
| ratio | 0.0625 to 4.0; 1.0 plays at the sound's rate. |
| int audio_channel_set_volume | ( | int | channel, |
| int | volume_percent ) |
Sets the channel volume and leaves pan and pitch unchanged. Applies at once to a playing sound and persists.
| channel | 0 to 23. |
| volume_percent | 0 to 100. |
| int audio_channel_set_volume_and_pan | ( | int | channel, |
| int | volume_percent, | ||
| int | pan ) |
Sets volume and pan together. Applies at once to a playing sound and persists.
| channel | 0 to 23. |
| volume_percent | 0 to 100. |
| pan | -100 (left) to 100 (right), 0 centered; it works as a balance for stereo sounds. |
| int audio_channel_stop | ( | int | channel | ) |
Stops the sound on a channel. Volume, pan and pitch are kept.
| channel | 0 to 23. |
| int audio_play_sound | ( | audio_sound_t | sound | ) |
Plays a sound on the first idle channel, searching from channel 0. The channel is reset to volume 100, centered, normal pitch before the sound starts.
| sound | A handle from a load function. |