pspsdk-1.0+beta2
pspaudio.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * pspaudio.h - Prototypes for the sceAudio library.
7  *
8  * Copyright (c) 2005 Adresd
9  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
10  * Copyright (c) 2007 cooleyes
11  * Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
12  * Copyright (c) 2008 David Perry <tias_dp@hotmail.com>
13  *
14  * $Id: pspaudio.h 2433 2008-10-15 10:00:27Z iwn $
15  */
16 #ifndef PSPAUDIO_H
17 #define PSPAUDIO_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
28 
30 #define PSP_AUDIO_VOLUME_MAX 0x8000
31 
33 #define PSP_AUDIO_CHANNEL_MAX 8
34 
36 #define PSP_AUDIO_NEXT_CHANNEL (-1)
37 
39 {
44 };
45 
46 typedef struct
47 {
49  int unknown1;
50  int gain;
52  int unknown2;
54  int unknown3;
56  int unknown4;
58  int unknown5;
59 
61 
63 #define PSP_AUDIO_SAMPLE_MIN 64
64 
66 #define PSP_AUDIO_SAMPLE_MAX 65472
67 
69 #define PSP_AUDIO_SAMPLE_ALIGN(s) (((s) + 63) & ~63)
70 
84 int sceAudioChReserve(int channel, int samplecount, int format);
85 
93 int sceAudioChRelease(int channel);
94 
106 int sceAudioOutput(int channel, int vol, void *buf);
107 
119 int sceAudioOutputBlocking(int channel, int vol, void *buf);
120 
134 int sceAudioOutputPanned(int channel, int leftvol, int rightvol, void *buf);
135 
149 int sceAudioOutputPannedBlocking(int channel, int leftvol, int rightvol, void *buf);
150 
158 int sceAudioGetChannelRestLen(int channel);
159 
167 int sceAudioGetChannelRestLength(int channel);
168 
177 int sceAudioSetChannelDataLen(int channel, int samplecount);
178 
188 int sceAudioChangeChannelConfig(int channel, int format);
189 
201 int sceAudioChangeChannelVolume(int channel, int leftvol, int rightvol);
202 
203 //sceAudioOneshotOutput ???
204 
212 int sceAudioOutput2Reserve(int samplecount);
213 
219 int sceAudioOutput2Release(void);
220 
228 int sceAudioOutput2ChangeLength(int samplecount);
229 
239 int sceAudioOutput2OutputBlocking(int vol, void *buf);
240 
247 
259 int sceAudioSRCChReserve(int samplecount, int freq, int channels);
260 
266 int sceAudioSRCChRelease(void);
267 
277 int sceAudioSRCOutputBlocking(int vol, void *buf);
278 
290 int sceAudioInputInit(int unknown1, int gain, int unknown2);
291 
300 
312 int sceAudioInputBlocking(int samplecount, int freq, void *buf);
313 
325 int sceAudioInput(int samplecount, int freq, void *buf);
326 
332 int sceAudioGetInputLength(void);
333 
339 int sceAudioWaitInputEnd(void);
340 
346 int sceAudioPollInputEnd(void);
347 
350 #ifdef __cplusplus
351 }
352 #endif
353 
354 #endif /* PSPAUDIO_H */