sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
audsrv.h
Go to the documentation of this file.
1
12
13#ifndef AUDSRV_H
14#define AUDSRV_H
15
17#define AUDSRV_IRX 0x870884e
18
19#define MIN_VOLUME 0
20#define MAX_VOLUME 100
21
28#define AUDSRV_ERR_NOERROR 0x0000
29#define AUDSRV_ERR_NOT_INITIALIZED 0x0001
30#define AUDSRV_ERR_RPC_FAILED 0x0002
31#define AUDSRV_ERR_FORMAT_NOT_SUPPORTED 0x0003
32#define AUDSRV_ERR_OUT_OF_MEMORY 0x0004
33#define AUDSRV_ERR_ARGS 0x0005
34#define AUDSRV_ERR_NO_DISC 0x0006
35#define AUDSRV_ERR_NO_MORE_CHANNELS 0x0007
36#define AUDSRV_ERR_FAILED_TO_LOAD_ADPCM 0x0010
37#define AUDSRV_ERR_FAILED_TO_CREATE_SEMA 0x0011
39
41typedef struct audsrv_fmt_t
42{
43 int freq;
44 int bits;
47
49typedef struct audsrv_adpcm_t
50{
51 int pitch;
52 int loop;
54 void *buffer;
55 int size;
57
58#ifdef __cplusplus
59extern "C" {
60#endif
61
63typedef int (*audsrv_callback_t)(void *arg);
64
70
75int audsrv_init(void);
76
81int audsrv_quit(void);
82
89
95int audsrv_wait_audio(int bytes);
96
102int audsrv_set_volume(int volume);
103
110int audsrv_play_audio(const char *chunk, int bytes);
111
117
120
122const char *audsrv_get_error_string(void);
123
126
129
139int audsrv_on_fillbuf(int amount, audsrv_callback_t cb, void *arg);
140
142
150int audsrv_play_cd(int track);
166int audsrv_play_sectors(int start, int end);
174
181
187
195int audsrv_adpcm_set_volume_and_pan(int ch, int vol, int pan);
196
198#define audsrv_adpcm_set_volume(ch, vol) audsrv_adpcm_set_volume_and_pan(ch, vol, 0)
199
207int audsrv_load_adpcm(audsrv_adpcm_t *adpcm, void *buffer, int size);
208
217
219#define audsrv_play_adpcm(adpcm) audsrv_ch_play_adpcm(-1, adpcm)
220
226
232
234
235#ifdef __cplusplus
236}
237#endif
238
239#endif
int(*) audsrv_callback_t(void *arg)
Definition audsrv.h:63
int audsrv_play_sectors(int start, int end)
int audsrv_resume_cd(void)
int audsrv_pause_cd(void)
int audsrv_get_cdpos(void)
int audsrv_get_numtracks(void)
int audsrv_on_cdda_stop(audsrv_callback_t cb, void *arg)
int audsrv_stop_cd(void)
int audsrv_play_cd(int track)
int audsrv_get_cd_status(void)
int audsrv_get_trackpos(void)
int audsrv_get_track_offset(int track)
int audsrv_get_cd_type(void)
int audsrv_is_adpcm_playing(int ch, audsrv_adpcm_t *adpcm)
int audsrv_ch_play_adpcm(int ch, audsrv_adpcm_t *adpcm)
int audsrv_adpcm_init(void)
int audsrv_load_adpcm(audsrv_adpcm_t *adpcm, void *buffer, int size)
int audsrv_adpcm_set_volume_and_pan(int ch, int vol, int pan)
int audsrv_free_adpcm(audsrv_adpcm_t *adpcm)
int audsrv_init(void)
int audsrv_quit(void)
int audsrv_queued(void)
const char * audsrv_get_error_string(void)
int audsrv_play_audio(const char *chunk, int bytes)
int audsrv_available(void)
int audsrv_get_error(void)
int audsrv_set_volume(int volume)
int audsrv_stop_audio(void)
int audsrv_on_fillbuf(int amount, audsrv_callback_t cb, void *arg)
int audsrv_wait_audio(int bytes)
int audsrv_set_format(struct audsrv_fmt_t *fmt)
void * buffer
Definition audsrv.h:54
int channels
Definition audsrv.h:45