vitasdk
Documentation of the vitasdk

Exports for User. More...

Enumerations

enum  SceAudioInErrorCode {
  SCE_AUDIO_IN_ERROR_FATAL = 0x80260100 , SCE_AUDIO_IN_ERROR_INVALID_PORT = 0x80260101 , SCE_AUDIO_IN_ERROR_INVALID_SIZE = 0x80260102 , SCE_AUDIO_IN_ERROR_INVALID_SAMPLE_FREQ = 0x80260103 ,
  SCE_AUDIO_IN_ERROR_INVALID_PORT_TYPE = 0x80260104 , SCE_AUDIO_IN_ERROR_INVALID_POINTER = 0x80260105 , SCE_AUDIO_IN_ERROR_INVALID_PORT_PARAM = 0x80260106 , SCE_AUDIO_IN_ERROR_PORT_FULL = 0x80260107 ,
  SCE_AUDIO_IN_ERROR_OUT_OF_MEMORY = 0x80260108 , SCE_AUDIO_IN_ERROR_NOT_OPENED = 0x80260109 , SCE_AUDIO_IN_ERROR_BUSY = 0x8026010A , SCE_AUDIO_IN_ERROR_INVALID_PARAMETER = 0x8026010B
}
 
enum  SceAudioInPortType { SCE_AUDIO_IN_PORT_TYPE_VOICE = 0 , SCE_AUDIO_IN_PORT_TYPE_RAW = 2 , SCE_AUDIO_IN_PORT_TYPE_DIAG = 14 , SCE_AUDIO_IN_PORT_TYPE_CAMERA = 0x20 }
 
enum  SceAudioInParam { SCE_AUDIO_IN_PARAM_FORMAT_S16_MONO = 0 , SCE_AUDIO_IN_GETSTATUS_MUTE = 1 }
 
enum  SceAudioInMuteCommand { SCE_AUDIO_IN_MUTE = 1 , SCE_AUDIO_IN_UNMUTE = 2 }
 Commands accepted by sceAudioInSetMute. More...
 
enum  SceAudioInInputMode {
  SCE_AUDIO_IN_INPUT_MODE_NONE = -1 , SCE_AUDIO_IN_INPUT_MODE_BUILTIN_MIC = 0 , SCE_AUDIO_IN_INPUT_MODE_HEADSET_MIC = 1 , SCE_AUDIO_IN_INPUT_MODE_CODEC_2 = 2 ,
  SCE_AUDIO_IN_INPUT_MODE_BLUETOOTH = 0x10 , SCE_AUDIO_IN_INPUT_MODE_VITA_TV = 0x20
}
 Audio-input routes used by sceAudioInSelectInput and ksceAudioInSelectInput. More...
 

Functions

int sceAudioInOpenPort (SceAudioInPortType portType, int grain, int freq, SceAudioInParam param)
 Open an audio-input port.
 
int sceAudioInOpenPortForDiag (SceAudioInPortType port_type, int grain, int freq, SceAudioInParam param)
 Open an audio-input port using the diagnostic entry point.
 
int sceAudioInReleasePort (int port)
 Release an audio-input port owned by the calling process.
 
int sceAudioInInput (int port, void *destPtr)
 Capture the configured number of mono signed 16-bit PCM samples.
 
int sceAudioInInputWithInputDeviceState (int port, void *dest_ptr, int *input_device_state)
 Capture the configured number of samples and report an input-route change.
 
int sceAudioInGetAdopt (SceAudioInPortType portType)
 Check whether the calling process owns the adopted audio-input port.
 
int sceAudioInGetStatus (int select)
 Query audio-input state.
 
int sceAudioInGetInput (void)
 Get the current input route.
 
int sceAudioInSelectInput (SceAudioInInputMode input_mode)
 Select the input route.
 
int sceAudioInSetMute (SceAudioInMuteCommand command)
 Set the system microphone mute state.
 
int sceAudioInSetMicGain (int port, int gain)
 Set the microphone-gain value stored for a port.
 
int sceAudioInGetMicGain (int port)
 Get the microphone-gain value stored for a port.
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceAudioIn_stub




Using this library in your project

Include the header file in your project:



Enumeration Type Documentation

◆ SceAudioInErrorCode

Enumerator
SCE_AUDIO_IN_ERROR_FATAL 

AudioIn is not initialized.

SCE_AUDIO_IN_ERROR_INVALID_PORT 

Defined, but FW 3.60 SceAudioin does not return it directly.

SCE_AUDIO_IN_ERROR_INVALID_SIZE 

Invalid grain size.

SCE_AUDIO_IN_ERROR_INVALID_SAMPLE_FREQ 

Invalid sample frequency.

SCE_AUDIO_IN_ERROR_INVALID_PORT_TYPE 

Invalid port type.

SCE_AUDIO_IN_ERROR_INVALID_POINTER 

Invalid pointer.

SCE_AUDIO_IN_ERROR_INVALID_PORT_PARAM 

Invalid port parameter.

SCE_AUDIO_IN_ERROR_PORT_FULL 

The process already owns a port on FW 3.60.

SCE_AUDIO_IN_ERROR_OUT_OF_MEMORY 

All four port slots are in use on FW 3.60.

SCE_AUDIO_IN_ERROR_NOT_OPENED 

The port is not open.

SCE_AUDIO_IN_ERROR_BUSY 

Defined, but FW 3.60 SceAudioin does not return it directly.

SCE_AUDIO_IN_ERROR_INVALID_PARAMETER 

Invalid parameter.

◆ SceAudioInPortType

Enumerator
SCE_AUDIO_IN_PORT_TYPE_VOICE 

Voice capture profile.

SCE_AUDIO_IN_PORT_TYPE_RAW 

Raw capture profile.

SCE_AUDIO_IN_PORT_TYPE_DIAG 

Diagnostic profile accepted only by sceAudioInOpenPortForDiag.

SCE_AUDIO_IN_PORT_TYPE_CAMERA 

PhotoCam capture profile with temporary route-change reporting.

◆ SceAudioInParam

Enumerator
SCE_AUDIO_IN_PARAM_FORMAT_S16_MONO 

Mono signed 16-bit PCM; the only port format accepted on FW 3.60.

SCE_AUDIO_IN_GETSTATUS_MUTE 

System microphone-mute selector for sceAudioInGetStatus.

◆ SceAudioInMuteCommand

Commands accepted by sceAudioInSetMute.

Enumerator
SCE_AUDIO_IN_MUTE 

Set the system microphone-mute flag.

SCE_AUDIO_IN_UNMUTE 

Clear the system microphone-mute flag.

◆ SceAudioInInputMode

Audio-input routes used by sceAudioInSelectInput and ksceAudioInSelectInput.

FW 3.60 has explicit input-source selection code for values 0, 1, 2, 0x10, and 0x20. The value -1 is used after initialization and suspend; selecting it through the API does not disable the previously active input source.

Enumerator
SCE_AUDIO_IN_INPUT_MODE_NONE 

No current route is recorded internally.

SCE_AUDIO_IN_INPUT_MODE_BUILTIN_MIC 

Handheld built-in microphone.

SCE_AUDIO_IN_INPUT_MODE_HEADSET_MIC 

Wired headset microphone.

SCE_AUDIO_IN_INPUT_MODE_CODEC_2 

Codec interface profile 2; its physical input source is unknown.

SCE_AUDIO_IN_INPUT_MODE_BLUETOOTH 

Bluetooth microphone PCM supplied by ksceAudioInSubmitBluetoothPcm.

SCE_AUDIO_IN_INPUT_MODE_VITA_TV 

Vita TV input profile.

Function Documentation

◆ sceAudioInOpenPort()

int sceAudioInOpenPort ( SceAudioInPortType  portType,
int  grain,
int  freq,
SceAudioInParam  param 
)

Open an audio-input port.

FW 3.60 supports at most four ports globally and one port per process. SCE_AUDIO_IN_PORT_TYPE_VOICE accepts 256 or 512 samples at 16000 Hz. SCE_AUDIO_IN_PORT_TYPE_RAW accepts 256 samples at 16000 Hz or 768 samples at 48000 Hz. SCE_AUDIO_IN_PORT_TYPE_CAMERA accepts 256 or 512 samples at 16000 Hz.

On FW 3.60, successful handles range from 0x80 through 0xFF. In addition to the named profiles above, any other nonnegative port type below 0x400 whose low four bits are zero is accepted, as are 0x12 and 0x1F. The purpose of these additional values is unknown, and they have no confirmed first-party uses.

Parameters
[in]port_type- Capture profile.
[in]grain- Number of mono samples returned by each input call.
[in]freq- Sample frequency in Hz.
[in]param- Must be SCE_AUDIO_IN_PARAM_FORMAT_S16_MONO on FW 3.60.
Returns
A port handle on success, or a negative error code. Most validation failures use SceAudioInErrorCode.

◆ sceAudioInOpenPortForDiag()

int sceAudioInOpenPortForDiag ( SceAudioInPortType  port_type,
int  grain,
int  freq,
SceAudioInParam  param 
)

Open an audio-input port using the diagnostic entry point.

This performs the same work as sceAudioInOpenPort. On FW 3.60 it also accepts SCE_AUDIO_IN_PORT_TYPE_DIAG without validating grain or freq; both values are still stored in the resulting port configuration.

Parameters
[in]port_type- Capture profile.
[in]grain- Number of mono samples returned by each input call.
[in]freq- Sample frequency in Hz.
[in]param- Must be SCE_AUDIO_IN_PARAM_FORMAT_S16_MONO on FW 3.60.
Returns
A port handle on success, or a negative error code. Most validation failures use SceAudioInErrorCode.

◆ sceAudioInReleasePort()

int sceAudioInReleasePort ( int  port)

Release an audio-input port owned by the calling process.

Parameters
[in]port- Port handle returned by sceAudioInOpenPort or sceAudioInOpenPortForDiag.
Returns
0 on success, or a negative error code.

◆ sceAudioInInput()

int sceAudioInInput ( int  port,
void *  destPtr 
)

Capture the configured number of mono signed 16-bit PCM samples.

This function blocks until the configured number of samples is available.

Parameters
[in]port- Port handle returned by sceAudioInOpenPort or sceAudioInOpenPortForDiag.
[out]dest_ptr- Buffer for the captured samples. Its size must be at least grain * sizeof(SceInt16) bytes.
Returns
0 on success, or a negative error code.

◆ sceAudioInInputWithInputDeviceState()

int sceAudioInInputWithInputDeviceState ( int  port,
void *  dest_ptr,
int *  input_device_state 
)

Capture the configured number of samples and report an input-route change.

For a port with device-state reporting enabled, such as the camera profile, FW 3.60 writes 1 for the first two successful captures after the input route changes and writes 0 afterward. This value does not indicate whether the input device is still connected. For other profiles FW 3.60 does not write input_device_state.

Parameters
[in]port- Port handle returned by sceAudioInOpenPort.
[out]dest_ptr- Buffer for the captured samples. Its size must be at least grain * sizeof(SceInt16) bytes.
[out]input_device_state- Receives the temporary route-change state when reporting is enabled for the port. Otherwise FW 3.60 does not access this pointer.
Returns
0 on success, or a negative error code.

◆ sceAudioInGetAdopt()

int sceAudioInGetAdopt ( SceAudioInPortType  portType)

Check whether the calling process owns the adopted audio-input port.

FW 3.60 accepts only SCE_AUDIO_IN_PORT_TYPE_VOICE and SCE_AUDIO_IN_PORT_TYPE_RAW. The selected type is validated but does not otherwise affect the result.

Parameters
[in]port_type- Port type to validate.
Returns
1 when the calling process owns a port and is the adopted input process, 0 otherwise, or a negative SceAudioInErrorCode value.

◆ sceAudioInGetStatus()

int sceAudioInGetStatus ( int  select)

Query audio-input state.

On Vita TV, FW 3.60 also reports the microphone as muted while the Bluetooth input is inactive.

Parameters
[in]select- SCE_AUDIO_IN_GETSTATUS_MUTE on FW 3.60.
Returns
1 when the system microphone is muted, 0 when it is not muted, or a negative error code for an unsupported selector. FW 3.60 returns SCE_AUDIO_IN_ERROR_INVALID_PORT_PARAM to processes built for an SDK older than 1.80, and SCE_AUDIO_IN_ERROR_INVALID_PARAMETER to processes built for SDK 1.80 or later.

◆ sceAudioInGetInput()

int sceAudioInGetInput ( void  )

Get the current input route.

Returns
The current route, normally one of SceAudioInInputMode.

◆ sceAudioInSelectInput()

int sceAudioInSelectInput ( SceAudioInInputMode  input_mode)

Select the input route.

The request is applied asynchronously by the input worker. FW 3.60 does not reject values outside SceAudioInInputMode: the worker records the requested value as the current route but does not explicitly select an input source for it.

Parameters
[in]input_mode- Input route.
Returns
0 when the route is already selected, otherwise the result of the FW 3.60 input-worker notification.

◆ sceAudioInSetMute()

int sceAudioInSetMute ( SceAudioInMuteCommand  command)

Set the system microphone mute state.

FW 3.60 ignores values other than SCE_AUDIO_IN_MUTE and SCE_AUDIO_IN_UNMUTE.

Parameters
[in]command- Mute command.
Returns
The updated internal AudioIn flags for a recognized command. An unrecognized command is returned unchanged.

◆ sceAudioInSetMicGain()

int sceAudioInSetMicGain ( int  port,
int  gain 
)

Set the microphone-gain value stored for a port.

FW 3.60 initializes this field to 0x1060 and stores the low 16 bits of gain. SceAudioin does not otherwise read it, so its units and purpose are unknown.

Parameters
[in]port- Port handle owned by the calling process.
[in]gain- Value to store.
Returns
0 on success, or a negative error code. An invalid handle or one not owned by the calling process returns SCE_AUDIO_IN_ERROR_INVALID_PORT_TYPE on FW 3.60.

◆ sceAudioInGetMicGain()

int sceAudioInGetMicGain ( int  port)

Get the microphone-gain value stored for a port.

Parameters
[in]port- Port handle owned by the calling process.
Returns
The sign-extended 16-bit value on success, or a negative error code. An invalid handle or one not owned by the calling process returns SCE_AUDIO_IN_ERROR_INVALID_PORT_TYPE on FW 3.60.