sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
audsrv.h File Reference

Go to the source code of this file.

Classes

struct  audsrv_fmt_t
struct  audsrv_adpcm_t

Macros

#define AUDSRV_IRX   0x870884e
#define MIN_VOLUME   0
#define MAX_VOLUME   100
#define AUDSRV_ERR_NOERROR   0x0000
#define AUDSRV_ERR_NOT_INITIALIZED   0x0001
#define AUDSRV_ERR_RPC_FAILED   0x0002
#define AUDSRV_ERR_FORMAT_NOT_SUPPORTED   0x0003
#define AUDSRV_ERR_OUT_OF_MEMORY   0x0004
#define AUDSRV_ERR_ARGS   0x0005
#define AUDSRV_ERR_NO_DISC   0x0006
#define AUDSRV_ERR_NO_MORE_CHANNELS   0x0007
#define AUDSRV_ERR_FAILED_TO_LOAD_ADPCM   0x0010
#define AUDSRV_ERR_FAILED_TO_CREATE_SEMA   0x0011
#define audsrv_adpcm_set_volume(ch, vol)
#define audsrv_play_adpcm(adpcm)

Typedefs

typedef struct audsrv_fmt_t audsrv_fmt_t
typedef struct audsrv_adpcm_t audsrv_adpcm_t
typedef int(*) audsrv_callback_t(void *arg)

Functions

int audsrv_init (void)
int audsrv_quit (void)
int audsrv_set_format (struct audsrv_fmt_t *fmt)
int audsrv_wait_audio (int bytes)
int audsrv_set_volume (int volume)
int audsrv_play_audio (const char *chunk, int bytes)
int audsrv_stop_audio (void)
int audsrv_get_error (void)
const char * audsrv_get_error_string (void)
int audsrv_available (void)
int audsrv_queued (void)
int audsrv_on_fillbuf (int amount, audsrv_callback_t cb, void *arg)
int audsrv_play_cd (int track)
int audsrv_stop_cd (void)
int audsrv_get_cdpos (void)
int audsrv_get_trackpos (void)
int audsrv_get_numtracks (void)
int audsrv_get_track_offset (int track)
int audsrv_pause_cd (void)
int audsrv_resume_cd (void)
int audsrv_play_sectors (int start, int end)
int audsrv_get_cd_status (void)
int audsrv_get_cd_type (void)
int audsrv_on_cdda_stop (audsrv_callback_t cb, void *arg)
int audsrv_adpcm_init (void)
int audsrv_adpcm_set_volume_and_pan (int ch, int vol, int pan)
int audsrv_load_adpcm (audsrv_adpcm_t *adpcm, void *buffer, int size)
int audsrv_ch_play_adpcm (int ch, audsrv_adpcm_t *adpcm)
int audsrv_is_adpcm_playing (int ch, audsrv_adpcm_t *adpcm)
int audsrv_free_adpcm (audsrv_adpcm_t *adpcm)

Detailed Description

audsrv source compatibility for the audio library.

Code written against the audsrv API builds and runs on top of audio without changes. Streaming maps onto the audio stream, samples onto audio sounds and channels. CD audio is not supported and reports AUDSRV_ERR_NO_DISC. Moving from audsrv to audio lists each call with its audio equivalent and the differences.

Licensed under the Academic Free License version 2.0.

Definition in file audsrv.h.

Macro Definition Documentation

◆ AUDSRV_IRX

#define AUDSRV_IRX   0x870884e

Id of the audsrv IOP module in the original API.

Definition at line 17 of file audsrv.h.

◆ MAX_VOLUME

#define MAX_VOLUME   100

Highest volume in percent.

Definition at line 20 of file audsrv.h.

◆ MIN_VOLUME

#define MIN_VOLUME   0

Lowest volume in percent.

Definition at line 19 of file audsrv.h.

Typedef Documentation

◆ audsrv_adpcm_t

typedef struct audsrv_adpcm_t audsrv_adpcm_t

A loaded ADPCM sample. Treat it as opaque: audsrv_load_adpcm() fills it and the other calls read it.

◆ audsrv_callback_t

typedef int(*) audsrv_callback_t(void *arg)

Callback type for audsrv_on_fillbuf() and audsrv_on_cdda_stop().

Definition at line 63 of file audsrv.h.

◆ audsrv_fmt_t

typedef struct audsrv_fmt_t audsrv_fmt_t

Stream format: output frequency in Hz, bits per sample (8 or 16), channels (1 or 2).