Files

107 lines
3.4 KiB
Odin
Raw Permalink Normal View History

2024-05-11 23:24:13 +02:00
package audioout
import "core:c"
import sce "../common"
foreign import audioout "system:SceAudio_stub"
foreign audioout {
/**
* Initialize audio port
*
* @param[in] type - One of ::SceAudioOutPortType
* @param[in] len - Number of samples, between ::SCE_AUDIO_MIN_LEN and ::SCE_AUDIO_MAX_LEN (multiple of 64)
* @param[in] freq - Sampling frequency (in Hz), one of the followings :
* 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
* @param[in] mode - One of ::SceAudioOutMode
*
* @return port number, < 0 on error.
* @note - The volume is initially set to its max value (::SCE_AUDIO_OUT_MAX_VOL)
*/
2024-05-13 16:04:23 +02:00
sceAudioOutOpenPort :: proc(type: SceAudioOutPortType, len: c.int, freq: c.int, mode: SceAudioOutMode) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Release an audio port
*
* @param[in] type - Port number returned by ::sceAudioOutOpenPort
*
* @return 0 on success, < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceAudioOutReleasePort :: proc(port: c.int) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Output audio (blocking function)
*
* @param[in] port - Port number returned by ::sceAudioOutOpenPort
* @param[in] *buf : Pointer to audio data buffer
*
* @return 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.
*/
2024-05-13 16:04:23 +02:00
sceAudioOutOutput :: proc(port: c.int, buf: rawptr) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Set volume of specified output audio port
*
* @param[in] port - Port number returned by ::sceAudioOutOpenPort
* @param[in] ch - Channel numbers as flags (see ::SceAudioOutChannelFlag)
* @param[in] *vol - Array to int specifying volume for each channel (Left channel first for stereo)
*
* @return 0 on success, < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceAudioOutSetVolume :: proc(port: c.int, ch: SceAudioOutChannelFlag, vol: ^c.int) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Change configuration of specified output port
*
* @param[in] port - Port number returned by ::sceAudioOutOpenPort
* @param[in] len - see ::sceAudioOutOpenPort()
* @param[in] freq - see ::sceAudioOutOpenPort()
* @param[in] mode - see ::sceAudioOutOpenPort()
*
* @return 0 on success, < 0 on error.
* @note - If (-1) is specified for any argument (excepted for port), current configuration is used instead.
*/
2024-05-13 16:04:23 +02:00
sceAudioOutSetConfig :: proc(port: c.int, len: sce.Size, freq: c.int, mode: SceAudioOutMode) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Get a parameter value of specified output port
*
* @param[in] port - Port number returned by ::sceAudioOutOpenPort
* @param[in] type - One of ::SceAudioOutConfigType
*
* @return 0 on success, < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceAudioOutGetConfig :: proc(port: c.int, type: SceAudioOutConfigType) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Set 'Automatic Level Control' mode on the BGM port
* ALC is also known as 'Dynamic Normalizer'
*
* @param[in] mode - One of ::SceAudioOutAlcMode
*
* @return 0 on success, < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceAudioOutSetAlcMode :: proc(mode: SceAudioOutAlcMode) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Get the number of remaining samples to be output on the specified port
*
* @param[in] port - Port number returned by ::sceAudioOutOpenPort
*
* @return Number of samples on success, < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceAudioOutGetRestSample :: proc(port: c.int) -> c.int ---
2024-05-11 23:24:13 +02:00
/**
* Get status of port type
* Return different value on whether the port type is used for sound generation or not.
*
* @param[in] type - One of ::SceAudioOutPortType
*
* @return (1) if port is in use, (0) otherwise. < 0 on error.
*/
2024-05-13 16:04:23 +02:00
sceAudioOutGetAdopt :: proc(type: SceAudioOutPortType) -> c.int ---
2024-05-11 23:24:13 +02:00
}