PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
audsrv.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2005, ps2dev - http://www.ps2dev.org
7# Licenced under GNU Library General Public License version 2
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __AUDSRV_H__
17#define __AUDSRV_H__
18
19#define AUDSRV_IRX 0x870884e
20
22#define MIN_VOLUME 0
23
25#define MAX_VOLUME 100
26
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
37#define AUDSRV_ERR_FAILED_TO_LOAD_ADPCM 0x0010
38#define AUDSRV_ERR_FAILED_TO_CREATE_SEMA 0x0011
39
41typedef struct audsrv_fmt_t
42{
44 int freq;
46 int bits;
50
52typedef struct audsrv_adpcm_t
53{
54 int pitch;
55 int loop;
56 int channels;
57 void *buffer;
58 int size;
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65typedef int (*audsrv_callback_t)(void *arg);
66
70int audsrv_init();
71
75int audsrv_quit();
76
86int audsrv_set_format(struct audsrv_fmt_t *fmt);
87
95int audsrv_wait_audio(int bytes);
96
101int audsrv_set_volume(int volume);
102
113int audsrv_play_audio(const char *chunk, int bytes);
114
119
123int audsrv_get_error();
124
128const char *audsrv_get_error_string();
129
134int audsrv_play_cd(int track);
135
139int audsrv_stop_cd();
140
147int audsrv_get_cdpos();
148
161
166
171int audsrv_get_track_offset(int track);
172
178int audsrv_pause_cd();
179
185int audsrv_resume_cd();
186
192int audsrv_play_sectors(int start, int end);
193
198
203
211int audsrv_on_fillbuf(int amount, audsrv_callback_t cb, void *arg);
212
220
227int audsrv_adpcm_set_volume_and_pan(int ch, int vol, int pan);
228#define audsrv_adpcm_set_volume(ch, vol) audsrv_adpcm_set_volume_and_pan(ch, vol, 0) //For backward-compatibility
229
236int audsrv_load_adpcm(audsrv_adpcm_t *adpcm, void *buffer, int size);
237
248int audsrv_ch_play_adpcm(int ch, audsrv_adpcm_t *adpcm);
249#define audsrv_play_adpcm(adpcm) audsrv_ch_play_adpcm(-1, adpcm) //For backward-compatibility
250
254int audsrv_is_adpcm_playing(int ch, audsrv_adpcm_t *adpcm);
255
262
268int audsrv_on_cdda_stop(audsrv_callback_t cb, void *arg);
269
277int audsrv_available();
278
284int audsrv_queued();
285
286#ifdef __cplusplus
287}
288#endif
289
290#endif /* __AUDSRV_H__ */
int audsrv_queued()
Definition audsrv_rpc.c:554
int audsrv_play_sectors(int start, int end)
Definition audsrv_rpc.c:202
int audsrv_get_numtracks()
Definition audsrv_rpc.c:224
int audsrv_is_adpcm_playing(int ch, audsrv_adpcm_t *adpcm)
Definition audsrv_rpc.c:487
int audsrv_get_error()
Definition audsrv_rpc.c:66
int audsrv_resume_cd()
Definition audsrv_rpc.c:239
int audsrv_init()
Definition audsrv_rpc.c:328
int audsrv_pause_cd()
Definition audsrv_rpc.c:234
int audsrv_get_cd_type()
Definition audsrv_rpc.c:244
int audsrv_play_audio(const char *chunk, int bytes)
Definition audsrv_rpc.c:254
int audsrv_on_cdda_stop(audsrv_callback_t cb, void *arg)
Definition audsrv_rpc.c:524
int audsrv_adpcm_init()
Definition audsrv_rpc.c:394
int audsrv_stop_audio()
Definition audsrv_rpc.c:292
int audsrv_ch_play_adpcm(int ch, audsrv_adpcm_t *adpcm)
Definition audsrv_rpc.c:481
int audsrv_play_cd(int track)
Definition audsrv_rpc.c:197
int audsrv_available()
Definition audsrv_rpc.c:549
int audsrv_get_trackpos()
Definition audsrv_rpc.c:219
int audsrv_load_adpcm(audsrv_adpcm_t *adpcm, void *buffer, int size)
Definition audsrv_rpc.c:430
const char * audsrv_get_error_string()
Definition audsrv_rpc.c:498
int audsrv_set_volume(int volume)
Definition audsrv_rpc.c:183
int audsrv_get_cdpos()
Definition audsrv_rpc.c:214
int audsrv_adpcm_set_volume_and_pan(int ch, int vol, int pan)
Definition audsrv_rpc.c:399
int audsrv_free_adpcm(audsrv_adpcm_t *adpcm)
Definition audsrv_rpc.c:492
int audsrv_stop_cd()
Definition audsrv_rpc.c:207
int audsrv_on_fillbuf(int amount, audsrv_callback_t cb, void *arg)
Definition audsrv_rpc.c:531
int audsrv_wait_audio(int bytes)
Definition audsrv_rpc.c:178
int audsrv_get_track_offset(int track)
Definition audsrv_rpc.c:229
int audsrv_set_format(struct audsrv_fmt_t *fmt)
Definition audsrv_rpc.c:159
int audsrv_get_cd_status()
Definition audsrv_rpc.c:249
int audsrv_quit()
Definition audsrv_rpc.c:143
int channels
Definition audsrv.h:48