vitasdk
Documentation of the vitasdk

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceAudio_stub



Functions

int sceAudioOutOpenPort (SceAudioOutPortType type, int len, int freq, SceAudioOutMode mode)
 Initialize audio port. More...
 
int sceAudioOutReleasePort (int port)
 Release an audio port. More...
 
int sceAudioOutOutput (int port, const void *buf)
 Output audio (blocking function) More...
 
int sceAudioOutSetVolume (int port, SceAudioOutChannelFlag ch, int *vol)
 Set volume of specified output audio port. More...
 
int sceAudioOutSetConfig (int port, SceSize len, int freq, SceAudioOutMode mode)
 Change configuration of specified output port. More...
 
int sceAudioOutGetConfig (int port, SceAudioOutConfigType type)
 Get a parameter value of specified output port. More...
 
int sceAudioOutSetAlcMode (SceAudioOutAlcMode mode)
 Set 'Automatic Level Control' mode on the BGM port ALC is also known as 'Dynamic Normalizer'. More...
 
int sceAudioOutGetRestSample (int port)
 Get the number of remaining samples to be output on the specified port. More...
 
int sceAudioOutGetAdopt (SceAudioOutPortType type)
 Get status of port type Return different value on whether the port type is used for sound generation or not. More...
 

Macros

#define SCE_AUDIO_MIN_LEN   64
 Minimum granularity. More...
 
#define SCE_AUDIO_MAX_LEN   65472
 Maximum granularity. More...
 
#define SCE_AUDIO_OUT_MAX_VOL   32768
 Maximum output port volume. More...
 
#define SCE_AUDIO_VOLUME_0DB   SCE_AUDIO_OUT_MAX_VOL
 Maximum output port volume. More...
 

Macro Definition Documentation

◆ SCE_AUDIO_MIN_LEN

#define SCE_AUDIO_MIN_LEN   64

Minimum granularity.

◆ SCE_AUDIO_MAX_LEN

#define SCE_AUDIO_MAX_LEN   65472

Maximum granularity.

◆ SCE_AUDIO_OUT_MAX_VOL

#define SCE_AUDIO_OUT_MAX_VOL   32768

Maximum output port volume.

◆ SCE_AUDIO_VOLUME_0DB

#define SCE_AUDIO_VOLUME_0DB   SCE_AUDIO_OUT_MAX_VOL

Maximum output port volume.

Enumeration Type Documentation

◆ SceAudioOutErrorCode

Enumerator
SCE_AUDIO_OUT_ERROR_NOT_OPENED 
SCE_AUDIO_OUT_ERROR_BUSY 
SCE_AUDIO_OUT_ERROR_INVALID_PORT 
SCE_AUDIO_OUT_ERROR_INVALID_POINTER 
SCE_AUDIO_OUT_ERROR_PORT_FULL 
SCE_AUDIO_OUT_ERROR_INVALID_SIZE 
SCE_AUDIO_OUT_ERROR_INVALID_FORMAT 
SCE_AUDIO_OUT_ERROR_INVALID_SAMPLE_FREQ 
SCE_AUDIO_OUT_ERROR_INVALID_VOLUME 
SCE_AUDIO_OUT_ERROR_INVALID_PORT_TYPE 
SCE_AUDIO_OUT_ERROR_INVALID_FX_TYPE 
SCE_AUDIO_OUT_ERROR_INVALID_CONF_TYPE 
SCE_AUDIO_OUT_ERROR_OUT_OF_MEMORY 

◆ SceAudioOutParam

Enumerator
SCE_AUDIO_OUT_PARAM_FORMAT_S16_MONO 
SCE_AUDIO_OUT_PARAM_FORMAT_S16_STEREO 

◆ SceAudioOutPortType

Enumerator
SCE_AUDIO_OUT_PORT_TYPE_MAIN 

Used for main audio output, freq must be set to 48000 Hz.

SCE_AUDIO_OUT_PORT_TYPE_BGM 

Used for Background Music port.

SCE_AUDIO_OUT_PORT_TYPE_VOICE 

Used for voice chat port.

◆ SceAudioOutMode

Enumerator
SCE_AUDIO_OUT_MODE_MONO 
SCE_AUDIO_OUT_MODE_STEREO 

◆ SceAudioOutChannelFlag

Flags to use as 'ch' argument for sceAudioOutSetVolume.

Enumerator
SCE_AUDIO_VOLUME_FLAG_L_CH 

Left Channel.

SCE_AUDIO_VOLUME_FLAG_R_CH 

Right Channel.

◆ SceAudioOutConfigType

Config type values to specify to sceAudioOutGetConfig.

Enumerator
SCE_AUDIO_OUT_CONFIG_TYPE_LEN 
SCE_AUDIO_OUT_CONFIG_TYPE_FREQ 
SCE_AUDIO_OUT_CONFIG_TYPE_MODE 

◆ SceAudioOutAlcMode

Argument 'mode' to specify to sceAudioOutSetAlcMode.

Enumerator
SCE_AUDIO_ALC_OFF 
SCE_AUDIO_ALC_MODE1 
SCE_AUDIO_ALC_MODE_MAX 

Function Documentation

◆ sceAudioOutOpenPort()

int sceAudioOutOpenPort ( SceAudioOutPortType  type,
int  len,
int  freq,
SceAudioOutMode  mode 
)

Initialize audio port.

Parameters
[in]type- One of SceAudioOutPortType
[in]len- Number of samples, between SCE_AUDIO_MIN_LEN and SCE_AUDIO_MAX_LEN (multiple of 64)
[in]freq- Sampling frequency (in Hz), one of the followings : 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
[in]mode- One of SceAudioOutMode
Returns
port number, < 0 on error.
Note
- The volume is initially set to its max value (SCE_AUDIO_OUT_MAX_VOL)

◆ sceAudioOutReleasePort()

int sceAudioOutReleasePort ( int  port)

Release an audio port.

Parameters
[in]type- Port number returned by sceAudioOutOpenPort
Returns
0 on success, < 0 on error.

◆ sceAudioOutOutput()

int sceAudioOutOutput ( int  port,
const void *  buf 
)

Output audio (blocking function)

Parameters
[in]port- Port number returned by sceAudioOutOpenPort
[in]*buf: Pointer to audio data buffer
Returns
0 on success, < 0 on error.
Note
- if NULL is specified for *buf, the function will not return until the last output audio data has been output.

◆ sceAudioOutSetVolume()

int sceAudioOutSetVolume ( int  port,
SceAudioOutChannelFlag  ch,
int *  vol 
)

Set volume of specified output audio port.

Parameters
[in]port- Port number returned by sceAudioOutOpenPort
[in]ch- Channel numbers as flags (see SceAudioOutChannelFlag)
[in]*vol- Array to int specifying volume for each channel (Left channel first for stereo)
Returns
0 on success, < 0 on error.

◆ sceAudioOutSetConfig()

int sceAudioOutSetConfig ( int  port,
SceSize  len,
int  freq,
SceAudioOutMode  mode 
)

Change configuration of specified output port.

Parameters
[in]port- Port number returned by sceAudioOutOpenPort
[in]len- see sceAudioOutOpenPort()
[in]freq- see sceAudioOutOpenPort()
[in]mode- see sceAudioOutOpenPort()
Returns
0 on success, < 0 on error.
Note
- If (-1) is specified for any argument (excepted for port), current configuration is used instead.

◆ sceAudioOutGetConfig()

int sceAudioOutGetConfig ( int  port,
SceAudioOutConfigType  type 
)

Get a parameter value of specified output port.

Parameters
[in]port- Port number returned by sceAudioOutOpenPort
[in]type- One of SceAudioOutConfigType
Returns
0 on success, < 0 on error.

◆ sceAudioOutSetAlcMode()

int sceAudioOutSetAlcMode ( SceAudioOutAlcMode  mode)

Set 'Automatic Level Control' mode on the BGM port ALC is also known as 'Dynamic Normalizer'.

Parameters
[in]mode- One of SceAudioOutAlcMode
Returns
0 on success, < 0 on error.

◆ sceAudioOutGetRestSample()

int sceAudioOutGetRestSample ( int  port)

Get the number of remaining samples to be output on the specified port.

Parameters
[in]port- Port number returned by sceAudioOutOpenPort
Returns
Number of samples on success, < 0 on error.

◆ sceAudioOutGetAdopt()

int sceAudioOutGetAdopt ( SceAudioOutPortType  type)

Get status of port type Return different value on whether the port type is used for sound generation or not.

Parameters
[in]type- One of SceAudioOutPortType
Returns
(1) if port is in use, (0) otherwise. < 0 on error.