sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
Loading the driver

The EE library talks to audio.irx, which the application loads before calling audio_init(). It needs libsd.irx loaded first. The library does not load modules itself, because a library archive cannot carry a module and an application may already have loaded them.

With ps2build, embed the modules in the program and load them from memory:

targets:
- name: game
type: ee
sources: [main.c]
libs: [audio]
embed_irx: [libsd, audio]
#include "libsd_irx.h"
#include "audio_irx.h"
SifInitRpc(0);
sbv_patch_enable_lmb();
SifExecModuleBuffer(libsd_irx, size_libsd_irx, 0, NULL, NULL);
SifExecModuleBuffer(audio_irx, size_audio_irx, 0, NULL, NULL);
int audio_init(void)

A minimal sound example:

audio_sound_load_apcm(file, file_size, &sound);
int32_t audio_sound_t
Definition audio.h:72
int audio_channel_play_sound(int channel, audio_sound_t sound)
int audio_channel_set_volume(int channel, int volume_percent)
int audio_sound_load_apcm(const void *file_data, int32_t file_size_bytes, audio_sound_t *sound_out)

A minimal stream example, feeding 44100 Hz stereo 16-bit PCM:

audio_stream_format_t format = {44100, 16, 2};
while (have_data) {
audio_stream_queue_pcm(chunk, chunk_bytes);
}
struct audio_stream_format audio_stream_format_t
int audio_stream_start(const audio_stream_format_t *format)
int audio_stream_queue_pcm(const void *pcm, int32_t byte_count)
int audio_stream_wait_until_writable(int32_t byte_count, int32_t timeout_ms)