PSPSDK 2024-12-16
Loading...
Searching...
No Matches
pspaudio.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
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 */
15#ifndef PSPAUDIO_H
16#define PSPAUDIO_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
27
29#define PSP_AUDIO_VOLUME_MAX 0x8000
30
32#define PSP_AUDIO_CHANNEL_MAX 8
33
35#define PSP_AUDIO_NEXT_CHANNEL (-1)
36
38#define SCE_AUDIO_ERROR_NOT_INITIALIZED (0x80260001)
39#define SCE_AUDIO_ERROR_OUTPUT_BUSY (0x80260002)
40#define SCE_AUDIO_ERROR_INVALID_CH (0x80260003)
41#define SCE_AUDIO_ERROR_PRIV_REQUIRED (0x80260004)
42#define SCE_AUDIO_ERROR_NOT_FOUND (0x80260005)
43#define SCE_AUDIO_ERROR_INVALID_SIZE (0x80260006)
44#define SCE_AUDIO_ERROR_INVALID_FORMAT (0x80260007)
45#define SCE_AUDIO_ERROR_NOT_RESERVED (0x80260008)
46#define SCE_AUDIO_ERROR_NOT_OUTPUT (0x80260009)
47#define SCE_AUDIO_ERROR_INVALID_FREQUENCY (0x8026000A)
48#define SCE_AUDIO_ERROR_INVALID_VOLUME (0x8026000B)
49#define SCE_AUDIO_ERROR_INPUT_BUSY (0x80260010)
50
58
59typedef struct
60{
63 int gain;
72
74
76#define PSP_AUDIO_SAMPLE_MIN 64
77
79#define PSP_AUDIO_SAMPLE_MAX 65472
80
82#define PSP_AUDIO_SAMPLE_ALIGN(s) (((s) + 63) & ~63)
83
97int sceAudioChReserve(int channel, int samplecount, int format);
98
106int sceAudioChRelease(int channel);
107
119int sceAudioOutput(int channel, int vol, void *buf);
120
132int sceAudioOutputBlocking(int channel, int vol, void *buf);
133
147int sceAudioOutputPanned(int channel, int leftvol, int rightvol, void *buf);
148
162int sceAudioOutputPannedBlocking(int channel, int leftvol, int rightvol, void *buf);
163
172
181
190int sceAudioSetChannelDataLen(int channel, int samplecount);
191
201int sceAudioChangeChannelConfig(int channel, int format);
202
214int sceAudioChangeChannelVolume(int channel, int leftvol, int rightvol);
215
216//sceAudioOneshotOutput ???
217
225int sceAudioOutput2Reserve(int samplecount);
226
233
241int sceAudioOutput2ChangeLength(int samplecount);
242
252int sceAudioOutput2OutputBlocking(int vol, void *buf);
253
260
272int sceAudioSRCChReserve(int samplecount, int freq, int channels);
273
280
290int sceAudioSRCOutputBlocking(int vol, void *buf);
291
303int sceAudioInputInit(int unknown1, int gain, int unknown2);
304
313
325int sceAudioInputBlocking(int samplecount, int freq, void *buf);
326
338int sceAudioInput(int samplecount, int freq, void *buf);
339
346
353
360
363#ifdef __cplusplus
364}
365#endif
366
367#endif /* PSPAUDIO_H */
int sceAudioWaitInputEnd(void)
Wait for non-blocking audio input to complete.
int sceAudioChangeChannelVolume(int channel, int leftvol, int rightvol)
Change the volume of a channel.
int sceAudioOutputPannedBlocking(int channel, int leftvol, int rightvol, void *buf)
Output panned audio of the specified channel (blocking)
int sceAudioInputBlocking(int samplecount, int freq, void *buf)
Perform audio input (blocking)
PspAudioFormats
Definition pspaudio.h:52
@ PSP_AUDIO_FORMAT_STEREO
Channel is set to stereo output.
Definition pspaudio.h:54
@ PSP_AUDIO_FORMAT_MONO
Channel is set to mono output.
Definition pspaudio.h:56
int sceAudioOutput2Reserve(int samplecount)
Reserve the audio output and set the output sample count.
int sceAudioOutput2OutputBlocking(int vol, void *buf)
Output audio (blocking)
int sceAudioPollInputEnd(void)
Poll for non-blocking audio input status.
int sceAudioChRelease(int channel)
Release a hardware output channel.
int sceAudioSRCOutputBlocking(int vol, void *buf)
Output audio.
int sceAudioOutput2Release(void)
Release the audio output.
int sceAudioGetInputLength(void)
Get the number of samples that were acquired.
int sceAudioOutput(int channel, int vol, void *buf)
Output audio of the specified channel.
int sceAudioInputInitEx(pspAudioInputParams *params)
Init audio input (with extra arguments)
int sceAudioInput(int samplecount, int freq, void *buf)
Perform audio input.
int sceAudioChReserve(int channel, int samplecount, int format)
Allocate and initialize a hardware output channel.
int sceAudioInputInit(int unknown1, int gain, int unknown2)
Init audio input.
int sceAudioChangeChannelConfig(int channel, int format)
Change the format of a channel.
int sceAudioSRCChRelease(void)
Release the audio output.
int sceAudioOutputBlocking(int channel, int vol, void *buf)
Output audio of the specified channel (blocking)
int sceAudioOutput2GetRestSample(void)
Get count of unplayed samples remaining.
int sceAudioOutput2ChangeLength(int samplecount)
Change the output sample count, after it's already been reserved.
int sceAudioSetChannelDataLen(int channel, int samplecount)
Change the output sample count, after it's already been reserved.
int sceAudioOutputPanned(int channel, int leftvol, int rightvol, void *buf)
Output panned audio of the specified channel.
int sceAudioGetChannelRestLength(int channel)
Get count of unplayed samples remaining.
int sceAudioGetChannelRestLen(int channel)
Get count of unplayed samples remaining.
int sceAudioSRCChReserve(int samplecount, int freq, int channels)
Reserve the audio output.
unsigned int unknown1
Definition psploadcore.h:5
unsigned int unknown2
Definition psploadcore.h:6
Definition pspaudio.h:60
int unknown5
Unknown.
Definition pspaudio.h:71
int unknown4
Unknown.
Definition pspaudio.h:69
int gain
Definition pspaudio.h:63
int unknown1
Unknown.
Definition pspaudio.h:62
int unknown2
Unknown.
Definition pspaudio.h:65
int unknown3
Unknown.
Definition pspaudio.h:67