![]() |
vitasdk
Documentation of the vitasdk
|
Exports for User. 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. | |
Exports for User.
Include the header file in your project:
Link the library to the executable:
Include the header file in your project:
| enum SceAudioInErrorCode |
| enum 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. |
| enum 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. |
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. |
| enum 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. |
| 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.
| [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. |
| 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.
| [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. |
| int sceAudioInReleasePort | ( | int | port | ) |
Release an audio-input port owned by the calling process.
| [in] | port | - Port handle returned by sceAudioInOpenPort or sceAudioInOpenPortForDiag. |
| 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.
| [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. |
| 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.
| [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. |
| 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.
| [in] | port_type | - Port type to validate. |
| 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.
| [in] | select | - SCE_AUDIO_IN_GETSTATUS_MUTE on FW 3.60. |
| int sceAudioInGetInput | ( | void | ) |
Get the current input route.
| 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.
| [in] | input_mode | - Input route. |
| 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.
| [in] | command | - Mute command. |
| 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.
| [in] | port | - Port handle owned by the calling process. |
| [in] | gain | - Value to store. |
| int sceAudioInGetMicGain | ( | int | port | ) |
Get the microphone-gain value stored for a port.
| [in] | port | - Port handle owned by the calling process. |