rtaudio/devices
device-count
(device-count [a :int] :int)
return the number of audio devices available.
| a | audio handle (ok-val from audio-new) |
Number of devices as :int.
(let [n (device-count a)] (println n))
Since: RA0
device-info
(device-info [a :int id :int] :int)
retrieve a device-info struct for the device at index id.
| a | audio handle (ok-val from audio-new) | |
| id | device index (0-based, must be < device-count) |
A __dev_info* as :int. Access fields with device-info-* accessors. Free with device-info-free when done.
(let [di (device-info a 0)]
(println (device-info-name di))
(device-info-free di))
Since: RA0
device-info-name
(device-info-name [di :int] :cstr)
return the device name string.
| di | device-info handle from device-info |
Device name as :cstr (owned by the di struct; do not free separately).
(println (device-info-name di))
Since: RA0
device-info-output-chans
(device-info-output-chans [di :int] :int)
return the number of output channels.
| di | device-info handle from device-info |
Output channel count as :int.
(println (device-info-output-chans di))
Since: RA0
device-info-input-chans
(device-info-input-chans [di :int] :int)
return the number of input channels.
| di | device-info handle from device-info |
Input channel count as :int.
(println (device-info-input-chans di))
Since: RA0
device-info-sample-rates
(device-info-sample-rates [di :int] :int)
return the supported sample rates as a cons list.
| di | device-info handle from device-info |
Cons list head as :int; each cell value is a sample rate in Hz. 0 is the empty-list sentinel.
(let [rates (device-info-sample-rates di)]
(while (!= rates 0)
(println (head rates))
(set! rates (tail rates))))
Since: RA0
device-default-output
(device-default-output [a :int] :int)
return the index of the default output device.
| a | audio handle (ok-val from audio-new) |
Default output device index as :int.
(let [id (device-default-output a)] ...)
Since: RA0
device-default-input
(device-default-input [a :int] :int)
return the index of the default input device.
| a | audio handle (ok-val from audio-new) |
Default input device index as :int.
(let [id (device-default-input a)] ...)
Since: RA0
device-info-free
(device-info-free [di :int] :void)
free all memory associated with a device-info handle.
| di | device-info handle from device-info |
void
(device-info-free di)
Since: RA0
Internal definitions
__nil-- return the empty list sentinel (0).__cons-- prepend a value to a cons list; returns new cell as :int.