rtaudio/core
src/rtaudio/core.tur
defopaque
Audio
(Audio)
opaque handle to an RtAudio instance (rtaudio_t).
defopaque
DeviceInfo
(DeviceInfo)
opaque handle to a heap __dev_info struct produced by
defn
audio-new
(audio-new [api : cstr] :)
create an RtAudio handle for the given backend API.
Parameters
| api | backend keyword: ":alsa", ":core-audio", ":wasapi", ":jack", ":dummy", | |
| or any other value for RTAUDIO_API_UNSPECIFIED (auto-select) |
Returns
(Result Audio int) -- ok carries the Audio handle; err carries 0 if rtaudio_create returned NULL. Free with audio-free when done.
Example
(let [r (audio-new ":core-audio")]
(if (ok? r) (let [a (ok-val r)] ...) (println "audio init failed")))
Since: RA0
defn
audio-free
(audio-free [a : Audio] :)
destroy an RtAudio handle created with audio-new.
Parameters
| a | audio handle (ok-val from audio-new) |
Returns
void
Example
(audio-free a)
Since: RA0
defn
audio-api
(audio-api [a : Audio] :)
return the name string of the active backend API.
Parameters
| a | audio handle (ok-val from audio-new) |
Returns
A :cstr naming the active API, e.g. "core", "alsa", "wasapi".
Example
(println (audio-api a))
Since: RA0