|
sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
|
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_available | ( | void | ) |
| int audsrv_get_error | ( | void | ) |
| const char * audsrv_get_error_string | ( | void | ) |
| int audsrv_init | ( | void | ) |
Starts the audio system. Calling it again is not an error.
| int audsrv_on_fillbuf | ( | int | amount, |
| audsrv_callback_t | cb, | ||
| void * | arg ) |
Calls cb(arg) when at least amount bytes of stream space are free, once each time the queue drains to that point. A NULL cb unregisters. The stream must be started. Returns 0, or -AUDSRV_ERR_ARGS if amount is larger than the stream buffer.
| amount | Free space that triggers the call. |
| cb | The function, or NULL. |
| arg | Passed to cb. |
| int audsrv_play_audio | ( | const char * | chunk, |
| int | bytes ) |
Queues audio in the stream format, waiting for space as needed so that all of it is accepted.
| chunk | The data. |
| bytes | Its size. |
| int audsrv_queued | ( | void | ) |
| int audsrv_quit | ( | void | ) |
Stops the audio system.
| int audsrv_set_format | ( | struct audsrv_fmt_t * | fmt | ) |
Sets the stream format and restarts the stream. The volume is kept.
| fmt | The format. |
| int audsrv_set_volume | ( | int | volume | ) |
Sets the stream volume. The volume of sample channels is separate.
| volume | Percent, 0 to 100. |
| int audsrv_stop_audio | ( | void | ) |
Stops the stream and discards queued data. The stream can be used again without audsrv_set_format().
| int audsrv_wait_audio | ( | int | bytes | ) |
Blocks until bytes can be queued.
| bytes | Size of the next chunk. |