sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
Lifecycle and global settings

Functions

int audio_init (void)
int audio_shutdown (void)
const char * audio_get_error_message (int error_code)
int audio_get_version (audio_version_t *version_out)
int audio_set_master_volume (int volume_percent)
int audio_get_channel_count (void)

Detailed Description

Function Documentation

◆ audio_get_channel_count()

int audio_get_channel_count ( void )

Number of mixer channels.

Returns
24, or -AUDIO_ERR_NOT_INITIALIZED.

◆ audio_get_error_message()

const char * audio_get_error_message ( int error_code)

Text for an error code.

Parameters
error_codeA code from Error codes, with either sign.
Returns
A static string. Never NULL. Works before audio_init().

◆ audio_get_version()

int audio_get_version ( audio_version_t * version_out)

Library and driver versions.

Parameters
[out]version_outReceives the versions; the driver fields are 0 when not initialized.
Returns
AUDIO_OK or -AUDIO_ERR_INVALID_ARGUMENT.

◆ audio_init()

int audio_init ( void )

Connects to the audio driver. audio.irx must already be loaded.

Returns
AUDIO_OK, -AUDIO_ERR_ALREADY_INITIALIZED, -AUDIO_ERR_RPC_FAILED or -AUDIO_ERR_OUT_OF_MEMORY.
Note
Blocks until the driver answers, up to about three seconds.

◆ audio_set_master_volume()

int audio_set_master_volume ( int volume_percent)

Scales the final mix of the stream and all channels.

Parameters
volume_percent0 (silent) to 100 (full). Values outside the range are rejected.
Returns
AUDIO_OK, -AUDIO_ERR_NOT_INITIALIZED or -AUDIO_ERR_INVALID_ARGUMENT.

◆ audio_shutdown()

int audio_shutdown ( void )

Stops everything, frees every sound and disconnects. Safe to call when not initialized.

Threads blocked in audio_stream_wait_until_writable() return -AUDIO_ERR_INTERRUPTED. Stop the threads that use the library before calling this.

Returns
AUDIO_OK.