![]() |
vitasdk
Documentation of the vitasdk
|
Exports for Kernel. More...
Typedefs | |
| typedef void(* | SceAudioInPortCallback) (ScePID process_id) |
| Callback called after an audio-input port is opened or released. | |
Functions | |
| int | ksceAudioInOpenPort (SceAudioInPortType port_type, int grain, int freq, SceAudioInParam param) |
| Open an audio-input port for the calling process. | |
| int | ksceAudioInReleasePort (int port) |
| Release an audio-input port owned by the calling process. | |
| int | ksceAudioInInput (int port, void *dest_ptr) |
| Capture the configured number of mono signed 16-bit PCM samples. | |
| SceBool | ksceAudioInIsAnyPortOpen (void) |
| Check whether any process owns an audio-input port. | |
| SceBool | ksceAudioInIsProcessPortOwner (ScePID process_id) |
| Check whether a process owns an audio-input port. | |
| int | ksceAudioInSetAdoptForPid (ScePID process_id, int unused1, int unused2, int transition_delay) |
| Select the process whose audio-input port is adopted. | |
| int | ksceAudioInSetPortOpenCallback (SceAudioInPortCallback callback) |
| Register or clear the port-open callback. | |
| int | ksceAudioInSetPortReleaseCallback (SceAudioInPortCallback callback) |
| Register or clear the port-release callback. | |
| int | ksceAudioInSelectInput (SceAudioInInputMode input_mode) |
| Select the input route. | |
| int | ksceAudioInSubmitBluetoothPcm (const SceInt16 *samples, SceSize sample_count) |
| Submit Bluetooth microphone PCM to AudioIn. | |
Exports for Kernel.
Include the header file in your project:
Link the library to the executable:
| typedef void(* SceAudioInPortCallback) (ScePID process_id) |
Callback called after an audio-input port is opened or released.
| [in] | process_id | - Owner PID for an opened port, or former owner PID for a released port. |
| int ksceAudioInOpenPort | ( | SceAudioInPortType | port_type, |
| int | grain, | ||
| int | freq, | ||
| SceAudioInParam | param | ||
| ) |
Open an audio-input port for the calling process.
| [in] | port_type | - Capture profile. See sceAudioInOpenPort. |
| [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 ksceAudioInReleasePort | ( | int | port | ) |
Release an audio-input port owned by the calling process.
| [in] | port | - Port handle returned by ksceAudioInOpenPort. |
| int ksceAudioInInput | ( | int | port, |
| void * | dest_ptr | ||
| ) |
Capture the configured number of mono signed 16-bit PCM samples.
| [in] | port | - Port handle returned by ksceAudioInOpenPort. |
| [out] | dest_ptr | - Kernel buffer for the captured samples. Its size must be at least grain * sizeof(SceInt16) bytes. |
| SceBool ksceAudioInIsAnyPortOpen | ( | void | ) |
Check whether any process owns an audio-input port.
Check whether a process owns an audio-input port.
| [in] | process_id | - Valid nonzero process ID. Passing 0 also matches an unused FW 3.60 port slot. |
| int ksceAudioInSetAdoptForPid | ( | ScePID | process_id, |
| int | unused1, | ||
| int | unused2, | ||
| int | transition_delay | ||
| ) |
Select the process whose audio-input port is adopted.
On FW 3.60 unused1 and unused2 are ignored. A nonzero transition_delay temporarily suppresses the selected process's input. The input worker subtracts 16 from this value per processing cycle. If the value reaches exactly zero while route-change reports remain, the worker holds it at 16 until both reports have been returned by input calls. Values that are not positive multiples of 16 can cross below zero and end suppression without that hold. AppMgr always passes zero on FW 3.60.
| [in] | process_id | - Process to adopt. |
| [in] | unused1 | - Ignored on FW 3.60. |
| [in] | unused2 | - Ignored on FW 3.60. |
| [in] | transition_delay | - Input-suppression countdown, or 0. |
| int ksceAudioInSetPortOpenCallback | ( | SceAudioInPortCallback | callback | ) |
Register or clear the port-open callback.
The callback runs synchronously after a port opens successfully and receives its owner PID. AudioIn releases its internal mutex before invoking it and returns the new handle after the callback completes.
| [in] | callback | - Callback, or NULL to clear it. |
| int ksceAudioInSetPortReleaseCallback | ( | SceAudioInPortCallback | callback | ) |
Register or clear the port-release callback.
The callback runs synchronously when a port is released, including during process exit or kill cleanup, and receives its former owner PID. It runs while AudioIn holds its internal mutex. The callback must not call an AudioIn operation that locks the same mutex, such as opening, releasing, or reading a port.
| [in] | callback | - Callback, or NULL to clear it. |
| int ksceAudioInSelectInput | ( | 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. |
Submit Bluetooth microphone PCM to AudioIn.
AVConfig uses this function after receiving Bluetooth audio. The samples are used only while Bluetooth input is active. FW 3.60 stores them in a 360-sample ring buffer and advances the expected producer position by 120 samples per submission. It inserts silence when the producer is more than 120 samples behind and trims input when the producer is more than 120 samples ahead. The worker upsamples the submitted stream by two using midpoint interpolation.
| [in] | samples | - Kernel-resident mono signed 16-bit PCM samples. This may be NULL only when sample_count is zero. |
| [in] | sample_count | - Number of 16-bit samples, not bytes. |