PSPSDK 2024-12-24
Loading...
Searching...
No Matches
pspatrac3.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 * pspatrac3.h - Prototypes for the sceAtrac3plus library
7 *
8 * Copyright (c) 2006 moonlight
9 *
10 */
11#ifndef __LIBATRAC3_H__
12#define __LIBATRAC3_H__
13
14#include <psptypes.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20/* Error code definition */
21#define PSP_ATRAC_SUCCESS SCE_OK
22
23#define PSP_ATRAC_ERROR_PARAM_FAIL (0x80630001)
24#define PSP_ATRAC_ERROR_API_FAIL (0x80630002)
25#define PSP_ATRAC_ERROR_NO_ATRACID (0x80630003)
26#define PSP_ATRAC_ERROR_BAD_CODECTYPE (0x80630004)
27#define PSP_ATRAC_ERROR_BAD_ATRACID (0x80630005)
28#define PSP_ATRAC_ERROR_UNKNOWN_FORMAT (0x80630006)
29#define PSP_ATRAC_ERROR_UNMATCH_FORMAT (0x80630007)
30#define PSP_ATRAC_ERROR_BAD_DATA (0x80630008)
31#define PSP_ATRAC_ERROR_ALLDATA_IS_ONMEMORY (0x80630009)
32#define PSP_ATRAC_ERROR_UNSET_DATA (0x80630010)
33
34#define PSP_ATRAC_ERROR_READSIZE_IS_TOO_SMALL (0x80630011)
35#define PSP_ATRAC_ERROR_NEED_SECOND_BUFFER (0x80630012)
36#define PSP_ATRAC_ERROR_READSIZE_OVER_BUFFER (0x80630013)
37#define PSP_ATRAC_ERROR_NOT_4BYTE_ALIGNMENT (0x80630014)
38#define PSP_ATRAC_ERROR_BAD_SAMPLE (0x80630015)
39#define PSP_ATRAC_ERROR_WRITEBYTE_FIRST_BUFFER (0x80630016)
40#define PSP_ATRAC_ERROR_WRITEBYTE_SECOND_BUFFER (0x80630017)
41#define PSP_ATRAC_ERROR_ADD_DATA_IS_TOO_BIG (0x80630018)
42
43#define PSP_ATRAC_ERROR_UNSET_PARAM (0x80630021)
44#define PSP_ATRAC_ERROR_NONEED_SECOND_BUFFER (0x80630022)
45#define PSP_ATRAC_ERROR_NODATA_IN_BUFFER (0x80630023)
46#define PSP_ATRAC_ERROR_ALLDATA_WAS_DECODED (0x80630024)
47
48/* Audio Codec ID */
49#define PSP_ATRAC_AT3PLUS (0x00001000)
50#define PSP_ATRAC_AT3 (0x00001001)
51
52/* Remain Frame typical Status */
53#define PSP_ATRAC_ALLDATA_IS_ON_MEMORY (-1)
54#define PSP_ATRAC_NONLOOP_STREAM_DATA_IS_ON_MEMORY (-2)
55#define PSP_ATRAC_LOOP_STREAM_DATA_IS_ON_MEMORY (-3)
56
68
69int sceAtracGetAtracID(u32 uiCodecType);
70
79int sceAtracSetDataAndGetID(void *buf, SceSize bufsize);
80
95int sceAtracDecodeData(int atracID, u16 *outSamples, int *outN, int *outEnd, int *outRemainFrame);
96
107int sceAtracGetRemainFrame(int atracID, int *outRemainFrame);
108
120int sceAtracGetStreamDataInfo(int atracID, u8** writePointer, u32* availableBytes, u32* readOffset);
121
129int sceAtracAddStreamData(int atracID, unsigned int bytesToAdd);
130
140int sceAtracGetBitrate(int atracID, int *outBitrate);
141
151int sceAtracSetLoopNum(int atracID, int nloops);
152
161int sceAtracReleaseAtracID(int atracID);
162
172int sceAtracGetNextSample(int atracID, int *outN);
173
183int sceAtracGetMaxSample(int atracID, int *outMax);
184
185int sceAtracGetBufferInfoForReseting(int atracID, u32 uiSample, PspBufferInfo *pBufferInfo);
186
187int sceAtracGetChannel(int atracID, u32 *puiChannel);
188
189int sceAtracGetInternalErrorInfo(int atracID, int *piResult);
190
191int sceAtracGetLoopStatus(int atracID, int *piLoopNum, u32 *puiLoopStatus);
192
193int sceAtracGetNextDecodePosition(int atracID, u32 *puiSamplePosition);
194
195int sceAtracGetSecondBufferInfo(int atracID, u32 *puiPosition, u32 *puiDataByte);
196
197int sceAtracGetSoundSample(int atracID, int *piEndSample, int *piLoopStartSample, int *piLoopEndSample);
198
199int sceAtracResetPlayPosition(int atracID, u32 uiSample, u32 uiWriteByteFirstBuf, u32 uiWriteByteSecondBuf);
200
201int sceAtracSetData(int atracID, u8 *pucBufferAddr, u32 uiBufferByte);
202
203int sceAtracSetHalfwayBuffer(int atracID, u8 *pucBufferAddr, u32 uiReadByte, u32 uiBufferByte);
204
205int sceAtracSetHalfwayBufferAndGetID(u8 *pucBufferAddr, u32 uiReadByte, u32 uiBufferByte);
206
207int sceAtracSetSecondBuffer(int atracID, u8 *pucSecondBufferAddr, u32 uiSecondBufferByte);
208
209#ifdef __cplusplus
210}
211#endif
212
213#endif
int sceAtracGetSoundSample(int atracID, int *piEndSample, int *piLoopStartSample, int *piLoopEndSample)
int sceAtracGetBitrate(int atracID, int *outBitrate)
Gets the bitrate.
int sceAtracSetLoopNum(int atracID, int nloops)
Sets the number of loops for this atrac ID.
int sceAtracGetStreamDataInfo(int atracID, u8 **writePointer, u32 *availableBytes, u32 *readOffset)
int sceAtracGetMaxSample(int atracID, int *outMax)
Gets the maximum number of samples of the atrac3 stream.
int sceAtracAddStreamData(int atracID, unsigned int bytesToAdd)
int sceAtracGetLoopStatus(int atracID, int *piLoopNum, u32 *puiLoopStatus)
int sceAtracDecodeData(int atracID, u16 *outSamples, int *outN, int *outEnd, int *outRemainFrame)
Decode a frame of data.
int sceAtracSetHalfwayBuffer(int atracID, u8 *pucBufferAddr, u32 uiReadByte, u32 uiBufferByte)
int sceAtracSetData(int atracID, u8 *pucBufferAddr, u32 uiBufferByte)
int sceAtracGetNextDecodePosition(int atracID, u32 *puiSamplePosition)
int sceAtracReleaseAtracID(int atracID)
It releases an atrac ID.
int sceAtracSetDataAndGetID(void *buf, SceSize bufsize)
Creates a new Atrac ID from the specified data.
int sceAtracResetPlayPosition(int atracID, u32 uiSample, u32 uiWriteByteFirstBuf, u32 uiWriteByteSecondBuf)
int sceAtracGetInternalErrorInfo(int atracID, int *piResult)
int sceAtracGetBufferInfoForReseting(int atracID, u32 uiSample, PspBufferInfo *pBufferInfo)
int sceAtracSetSecondBuffer(int atracID, u8 *pucSecondBufferAddr, u32 uiSecondBufferByte)
int sceAtracGetSecondBufferInfo(int atracID, u32 *puiPosition, u32 *puiDataByte)
int sceAtracGetRemainFrame(int atracID, int *outRemainFrame)
Gets the remaining (not decoded) number of frames.
int sceAtracGetNextSample(int atracID, int *outN)
Gets the number of samples of the next frame to be decoded.
int sceAtracGetChannel(int atracID, u32 *puiChannel)
int sceAtracSetHalfwayBufferAndGetID(u8 *pucBufferAddr, u32 uiReadByte, u32 uiBufferByte)
int sceAtracGetAtracID(u32 uiCodecType)
unsigned int SceSize
Definition pspkerneltypes.h:27
uint8_t u8
Definition psptypes.h:38
uint16_t u16
Definition psptypes.h:39
uint32_t u32
Definition psptypes.h:41
Definition pspatrac3.h:57
u32 uiReadPositionSecondBuf
Definition pspatrac3.h:66
u32 uiWritableByteFirstBuf
Definition pspatrac3.h:59
u8 * pucWritePositionFirstBuf
Definition pspatrac3.h:58
u32 uiMinWriteByteSecondBuf
Definition pspatrac3.h:65
u32 uiReadPositionFirstBuf
Definition pspatrac3.h:61
u32 uiMinWriteByteFirstBuf
Definition pspatrac3.h:60
u32 uiWritableByteSecondBuf
Definition pspatrac3.h:64
u8 * pucWritePositionSecondBuf
Definition pspatrac3.h:63