Files

101 lines
3.1 KiB
Odin
Raw Permalink Normal View History

2024-05-11 23:24:13 +02:00
package usbaudioin
import "core:c"
import sce "../common"
foreign import usbaudioin "system:SceUsbAudioIn_stub"
foreign usbaudioin {
/**
* Open usb audio device
*
* @return 0 on success, < 0 on error
*
* @param[in] device_id - Device id
* @param[in] bits - Bits per sample. Only 16 allowed
* @param[in] rate - Bitrate in Hz. Only 48000 allowed
*/
2024-05-13 16:04:23 +02:00
sceUsbAudioInOpenDevice :: proc(device_id: sce.UInt32, bits: c.int, rate: c.int) -> sce.Int32 ---
2024-05-11 23:24:13 +02:00
/**
* Close usb audio device
*
* @return 0 on success, < 0 on error
*
* @param[in] device_id - Device id
*/
2024-05-13 16:04:23 +02:00
sceUsbAudioInCloseDevice :: proc(device_id: sce.UInt32) -> sce.Int32 ---
2024-05-11 23:24:13 +02:00
/**
* Get available audio usb devices
*
* @return 0 on success, < 0 on error
*
* @param[out] list - pointer to array of SceUsbAudioInDeviceListItem
* @param[out] device_count - connected device count
* @param[in] list_size - number of items in SceUsbAudioInDeviceListItem array
*
* @note While function accepts up to 127 as list_size it can only return maximum 7 devices
*/
2024-05-13 16:04:23 +02:00
sceUsbAudioInGetDeviceIdList :: proc(list: ^SceUsbAudioInDeviceListItem, device_count: ^sce.UInt32, list_size: sce.UInt32) -> sce.Int32 ---
2024-05-11 23:24:13 +02:00
/**
* Get usb audio device info
*
* @return 0 on success, < 0 on error
*
* @param[in] device_id - Device id
* @param[out] info - pointer to SceUsbAudioInDeviceInfo
*/
2024-05-13 16:04:23 +02:00
sceUsbAudioInGetDeviceInformation :: proc(device_id: sce.UInt32, info: ^SceUsbAudioInDeviceInfo) -> sce.Int32 ---
2024-05-11 23:24:13 +02:00
/**
* Get usb audio device max volume
*
* @return 0 on success, < 0 on error
*
* @param[in] device_id - Device id
* @param[out] volume - maximum device volume
*
* @note You should OpenDevice first to use this function
*/
2024-05-13 16:04:23 +02:00
sceUsbAudioInGetMaxValueOfVolume :: proc(device_id: sce.UInt32, volume: ^sce.UInt32) -> sce.Int32 ---
2024-05-11 23:24:13 +02:00
/**
* Get usb audio device min volume
*
* @return 0 on success, < 0 on error
*
* @param[in] device_id - Device id
* @param[out] volume - minimum device volume
*
* @note You should OpenDevice first to use this function
*/
2024-05-13 16:04:23 +02:00
sceUsbAudioInGetMinValueOfVolume :: proc(device_id: sce.UInt32, volume: ^sce.UInt32) -> sce.Int32 ---
2024-05-11 23:24:13 +02:00
/**
* Set usb audio device volume
*
* @return 0 on success, < 0 on error
*
* @param[in] device_id - Device id
* @param[in] volume - new device volume
*
* @note You should OpenDevice first to use this function
*/
2024-05-13 16:04:23 +02:00
sceUsbAudioInSetCurrentValueOfVolume :: proc(device_id: sce.UInt32, volume: sce.UInt32) -> sce.Int32 ---
2024-05-11 23:24:13 +02:00
/**
* Receive sound data from usb device
*
* @return 0 on success, < 0 on error
*
* @param[in] device_id - Device id
* @param[out] buffer - buffer for received data. Should be 0x600 bytes in size.
*
* @note You should call OpenDevice first to use this function
* @note Data is in S16_MONO format. Granularity is 768 (thus buffer is 768*2)
*/
2024-05-13 16:04:23 +02:00
sceUsbAudioInInput :: proc(device_id: sce.UInt32, buffer: rawptr) -> sce.Int32 ---
2024-05-11 23:24:13 +02:00
}