![]() |
vitasdk
Documentation of the vitasdk
|
Exports for User. More...
Macros | |
| #define | SCE_AUDIO_MIN_LEN 64 |
| Minimum frame-count granularity. | |
| #define | SCE_AUDIO_MAX_LEN 65472 |
| Maximum frame count. | |
| #define | SCE_AUDIO_OUT_MAX_VOL 32768 |
| Maximum Q15 output-port volume for game processes on FW 3.60. | |
| #define | SCE_AUDIO_VOLUME_0DB SCE_AUDIO_OUT_MAX_VOL |
| Q15 unity-gain output-port volume. | |
Functions | |
| int | sceAudioOutOpenPort (SceAudioOutPortType type, int len, int freq, SceAudioOutMode mode) |
| Open an audio-output port. | |
| int | sceAudioOutOpenExtPort (int len, SceAudioOutMode mode) |
| Open the calling process's dedicated extended MAIN port. | |
| int | sceAudioOutReleasePort (int port) |
| Release an audio-output port. | |
| int | sceAudioOutOutput (int port, const void *buf) |
| Output one configured PCM buffer. | |
| int | sceAudioOutSetVolume (int port, SceAudioOutChannelFlag ch, int *vol) |
| Set an output port's channel volume. | |
| int | sceAudioOutSetConfig (int port, SceSize len, int freq, SceAudioOutMode mode) |
| Change an output port's configuration. | |
| int | sceAudioOutGetConfig (int port, SceAudioOutConfigType type) |
| Get one property of an output port. | |
| int | sceAudioOutSetAlcMode (SceAudioOutAlcMode mode) |
| Set automatic level control for the calling process's BGM port. | |
| int | sceAudioOutSetCompress (int port, SceBool enable) |
| Set the compressed-audio profile of an open BGM or voice port. | |
| int | sceAudioOutSetEffectType (SceAudioOutEffectType effect_type) |
| Select the BGM seven-band graphic-equalizer preset for the calling process. | |
| int | sceAudioOutSetAdoptMode (SceAudioOutAdoptMode mode) |
| Select whether newly opened BGM and voice-profile ports are adopted automatically. | |
| int | sceAudioOutSetAdopt_forUser (SceAudioOutPortType type, SceBool adopt, int ramp_length, SceBool wait_for_completion) |
| Change the calling process's adoption state for one output profile. | |
| int | sceAudioOutSetPortVolume_forUser (int port_mask, SceUInt32 volume, int ramp_length) |
| Apply a private gain ramp to selected output profiles of the calling process. | |
| int | sceAudioOutGetPortVolume_forUser (SceAudioOutPortType type) |
| Get a private output-profile gain for the calling process. | |
| int | sceAudioOutGetRestSample (int port) |
| Get the number of frames remaining on an output port. | |
| int | sceAudioOutGetAdopt (SceAudioOutPortType type) |
| Check whether the calling process currently adopts an output profile. | |
Exports for User.
Include the header file in your project:
Link the library to the executable:
Include the header file in your project:
| #define SCE_AUDIO_MIN_LEN 64 |
Minimum frame-count granularity.
| #define SCE_AUDIO_MAX_LEN 65472 |
Maximum frame count.
| #define SCE_AUDIO_OUT_MAX_VOL 32768 |
Maximum Q15 output-port volume for game processes on FW 3.60.
| #define SCE_AUDIO_VOLUME_0DB SCE_AUDIO_OUT_MAX_VOL |
Q15 unity-gain output-port volume.
| enum SceAudioOutErrorCode |
| enum SceAudioOutParam |
Legacy signed 16-bit PCM format names.
Prefer SceAudioOutMode for new declarations.
| Enumerator | |
|---|---|
| SCE_AUDIO_OUT_PARAM_FORMAT_S16_MONO | |
| SCE_AUDIO_OUT_PARAM_FORMAT_S16_STEREO | |
| enum SceAudioOutPortType |
| Enumerator | |
|---|---|
| SCE_AUDIO_OUT_PORT_TYPE_MAIN | Main output; use SCE_AUDIO_OUT_SAMPLE_RATE_48000. |
| SCE_AUDIO_OUT_PORT_TYPE_BGM | Background-music output. |
| SCE_AUDIO_OUT_PORT_TYPE_VOICE | Voice-chat output. |
| SCE_AUDIO_OUT_PORT_TYPE_VOICE_COMPRESSED | Compressed voice; non-game processes only on FW 3.60. |
| enum SceAudioOutMode |
BGM seven-band graphic-equalizer presets.
The gains below apply to the 63 Hz, 160 Hz, 400 Hz, 1 kHz, 2.5 kHz, 6.3 kHz, and 16 kHz bands, in that order.
Audio-output sample rates.
Each AudioOut function accepts only the rates documented for that function.
Channel-flag bits accepted by sceAudioOutSetVolume.
| Enumerator | |
|---|---|
| SCE_AUDIO_VOLUME_FLAG_L_CH | Left channel. |
| SCE_AUDIO_VOLUME_FLAG_R_CH | Right channel. |
Configuration selectors accepted by sceAudioOutGetConfig.
| Enumerator | |
|---|---|
| SCE_AUDIO_OUT_CONFIG_TYPE_LEN | |
| SCE_AUDIO_OUT_CONFIG_TYPE_FREQ | |
| SCE_AUDIO_OUT_CONFIG_TYPE_MODE | |
| enum SceAudioOutAlcMode |
Automatic-level-control modes for sceAudioOutSetAlcMode.
| Enumerator | |
|---|---|
| SCE_AUDIO_ALC_OFF | Disable the BGM dynamic normalizer. |
| SCE_AUDIO_ALC_MODE1 | Enable the BGM dynamic normalizer. |
| SCE_AUDIO_ALC_MODE_MAX | Number of ALC modes; not a valid mode. |
| enum SceAudioOutPortMask |
| enum SceAudioOutAdoptMode |
New-port adoption behavior selected by sceAudioOutSetAdoptMode.
| int sceAudioOutOpenPort | ( | SceAudioOutPortType | type, |
| int | len, | ||
| int | freq, | ||
| SceAudioOutMode | mode | ||
| ) |
Open an audio-output port.
FW 3.60 supports one BGM port and one voice port per process, eight regular MAIN ports, and the dedicated extended MAIN port opened by sceAudioOutOpenExtPort. The MAIN profile requires SCE_AUDIO_OUT_SAMPLE_RATE_48000. BGM and voice accept every SceAudioOutSampleRate value except SCE_AUDIO_OUT_SAMPLE_RATE_44184; PSPemu may additionally use that rate.
| [in] | type | - Output profile. |
| [in] | len | - Number of PCM frames. Must be a multiple of SCE_AUDIO_MIN_LEN and no greater than SCE_AUDIO_MAX_LEN. |
| [in] | freq | - One of the SceAudioOutSampleRate values accepted by the selected output profile. |
| [in] | mode | - Mono or stereo signed 16-bit PCM. |
| int sceAudioOutOpenExtPort | ( | int | len, |
| SceAudioOutMode | mode | ||
| ) |
Open the calling process's dedicated extended MAIN port.
The port uses handle 8 and SCE_AUDIO_OUT_SAMPLE_RATE_48000 on FW 3.60.
| [in] | len | - Number of PCM frames. Must be a multiple of SCE_AUDIO_MIN_LEN and no greater than SCE_AUDIO_MAX_LEN. |
| [in] | mode | - Mono or stereo signed 16-bit PCM. |
| int sceAudioOutReleasePort | ( | int | port | ) |
Release an audio-output port.
| [in] | port | - Port handle returned by sceAudioOutOpenPort or sceAudioOutOpenExtPort. |
| int sceAudioOutOutput | ( | int | port, |
| const void * | buf | ||
| ) |
Output one configured PCM buffer.
The call blocks until the supplied buffer has been accepted. Passing NULL waits until the port's previously queued audio has finished playing.
| [in] | port | - Open port handle. |
| [in] | buf | - Interleaved signed 16-bit PCM, or NULL to wait for queued audio to finish playing. |
| int sceAudioOutSetVolume | ( | int | port, |
| SceAudioOutChannelFlag | ch, | ||
| int * | vol | ||
| ) |
Set an output port's channel volume.
| [in] | port | - Open port handle. |
| [in] | ch | - Bitwise OR of SceAudioOutChannelFlag values. |
| [in] | vol | - Read-only array containing the left- and right-channel Q15 volume values, in that order. FW 3.60 reads both values, including for a mono port. Game processes may use values from 0 through SCE_AUDIO_OUT_MAX_VOL; system and other non-game processes may use values through 0xFFFF. Channel-mask bits other than left and right are ignored. |
| int sceAudioOutSetConfig | ( | int | port, |
| SceSize | len, | ||
| int | freq, | ||
| SceAudioOutMode | mode | ||
| ) |
Change an output port's configuration.
A negative value for len, freq, or mode leaves that setting unchanged.
For a BGM port, the low byte of mode contains one of SceAudioOutMode, while its high byte contains one of SceAudioOutEffectType.
| [in] | port | - Open port handle. |
| [in] | len | - New frame count, or a negative value to leave it unchanged. |
| [in] | freq | - New SceAudioOutSampleRate value accepted by the output profile, or a negative value to leave it unchanged. |
| [in] | mode | - New channel mode and optional BGM effect preset, or a negative value to leave them unchanged. |
| int sceAudioOutGetConfig | ( | int | port, |
| SceAudioOutConfigType | type | ||
| ) |
Get one property of an output port.
| [in] | port | - Open port handle. |
| [in] | type | - Property to query. |
| int sceAudioOutSetAlcMode | ( | SceAudioOutAlcMode | mode | ) |
Set automatic level control for the calling process's BGM port.
Mode 1 enables the FW 3.60 dynamic normalizer; mode 0 bypasses it.
| [in] | mode | - Automatic-level-control mode. |
| int sceAudioOutSetCompress | ( | int | port, |
| SceBool | enable | ||
| ) |
| int sceAudioOutSetEffectType | ( | SceAudioOutEffectType | effect_type | ) |
Select the BGM seven-band graphic-equalizer preset for the calling process.
| [in] | effect_type | - Equalizer preset. |
| int sceAudioOutSetAdoptMode | ( | SceAudioOutAdoptMode | mode | ) |
Select whether newly opened BGM and voice-profile ports are adopted automatically.
| [in] | mode | - Adoption mode. Any nonzero value behaves as manual mode on FW 3.60. |
| int sceAudioOutSetAdopt_forUser | ( | SceAudioOutPortType | type, |
| SceBool | adopt, | ||
| int | ramp_length, | ||
| SceBool | wait_for_completion | ||
| ) |
Change the calling process's adoption state for one output profile.
| [in] | type | - MAIN, BGM, or voice port selector. |
| [in] | adopt | - SCE_TRUE to adopt the port, or SCE_FALSE to release it. |
| [in] | ramp_length | - Gain-transition duration in milliseconds, clamped to 1..4096 on FW 3.60. |
| [in] | wait_for_completion | - When releasing adoption, wait for the transition to finish if nonzero. |
| int sceAudioOutSetPortVolume_forUser | ( | int | port_mask, |
| SceUInt32 | volume, | ||
| int | ramp_length | ||
| ) |
Apply a private gain ramp to selected output profiles of the calling process.
This 0..256 gain is separate from the Q15 per-channel volume configured by sceAudioOutSetVolume. A zero mask does nothing, and FW 3.60 ignores mask bits not defined by SceAudioOutPortMask.
| [in] | port_mask | - Bitwise OR of SceAudioOutPortMask values. |
| [in] | volume | - Target gain from 0 through 256. |
| [in] | ramp_length | - Gain-transition duration in milliseconds, clamped to 1..4096 on FW 3.60. |
| int sceAudioOutGetPortVolume_forUser | ( | SceAudioOutPortType | type | ) |
Get a private output-profile gain for the calling process.
| [in] | type | - MAIN, BGM, or voice port selector. |
| int sceAudioOutGetRestSample | ( | int | port | ) |
Get the number of frames remaining on an output port.
| [in] | port | - Open port handle. |
| int sceAudioOutGetAdopt | ( | SceAudioOutPortType | type | ) |
Check whether the calling process currently adopts an output profile.
FW 3.60 also accepts SCE_AUDIO_OUT_PORT_TYPE_VOICE_COMPRESSED for a non-game process and queries the same adoption state as the voice profile. For the MAIN selector, this function returns 1 when the process's MAIN adoption flag is set or when the process has no selected MAIN port.
| [in] | type | - Output profile selector. |