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

Sounds played on channels 0 to 23. More...

Macros

#define audsrv_adpcm_set_volume(ch, vol)
#define audsrv_play_adpcm(adpcm)

Functions

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

Sounds played on channels 0 to 23.

Macro Definition Documentation

◆ audsrv_adpcm_set_volume

#define audsrv_adpcm_set_volume ( ch,
vol )
Value:
int audsrv_adpcm_set_volume_and_pan(int ch, int vol, int pan)

Sets the volume of a channel and the pan to center (pan 0).

Definition at line 198 of file audsrv.h.

◆ audsrv_play_adpcm

#define audsrv_play_adpcm ( adpcm)
Value:
int audsrv_ch_play_adpcm(int ch, audsrv_adpcm_t *adpcm)

Plays a sample on the first free channel.

Definition at line 219 of file audsrv.h.

Function Documentation

◆ audsrv_adpcm_init()

int audsrv_adpcm_init ( void )

Frees all loaded samples and stops every voice. The stream is not touched. Can be called repeatedly.

Returns
0 or a negative error.

◆ audsrv_adpcm_set_volume_and_pan()

int audsrv_adpcm_set_volume_and_pan ( int ch,
int vol,
int pan )

Sets volume and pan of a channel. Both persist across plays and can be set before the first play.

Parameters
chChannel 0 to 23.
volVolume in percent, 0 to 100.
pan-100 (left) to 100 (right), 0 centered.
Returns
0 on success, or a negative error.

◆ audsrv_ch_play_adpcm()

int audsrv_ch_play_adpcm ( int ch,
audsrv_adpcm_t * adpcm )

Plays a loaded sample on channel ch (0-23), replacing what is playing there. Any other value of ch plays it on the first free channel.

Parameters
chThe channel, or -1 for any free channel.
adpcmThe sample.
Returns
The channel number, or a negative error (-AUDSRV_ERR_NO_MORE_CHANNELS when none is free).

◆ audsrv_free_adpcm()

int audsrv_free_adpcm ( audsrv_adpcm_t * adpcm)

Frees a sample and clears its descriptor.

Returns
0 or a negative error.

◆ audsrv_is_adpcm_playing()

int audsrv_is_adpcm_playing ( int ch,
audsrv_adpcm_t * adpcm )

Whether this sample is playing on channel ch.

Returns
1 if it is, else 0.

◆ audsrv_load_adpcm()

int audsrv_load_adpcm ( audsrv_adpcm_t * adpcm,
void * buffer,
int size )

Loads an APCM sample image. The buffer can be freed on return.

Parameters
adpcmReceives the sample descriptor.
bufferThe whole file.
sizeIts size.
Returns
0, or a negative error (-AUDSRV_ERR_FAILED_TO_LOAD_ADPCM for data that is not a valid image).