No matching definitions.

rtaudio/stream

src/rtaudio/stream.tur
defn

stream-open

(stream-open [a : Audio out-device : int out-chans : int in-device : int in-chans : int format : cstr sample-rate : int buf-frames : int callback : (c-fn [ptr<void> ptr<void> int float int ptr<void>])

configure and open an audio stream.

aaudio handle (ok-val from audio-new)
out-deviceoutput device index (-1 to disable output)
out-chansnumber of output channels (0 to disable output)
in-deviceinput device index (-1 to disable input)
in-chansnumber of input channels (0 to disable input)
formatsample format keyword: ":int16", ":int32", ":float32", ":float64"
sample-ratedesired sample rate in Hz (e.g. 44100, 48000)
buf-framesbuffer size in frames (e.g. 256, 512)
callbackcaptureless C-ABI audio callback of shape
`int (*)(void *out, void *in, unsigned int nFrames,
double stream_time, rtaudio_stream_status_t status,
void *userdata)`, spelled
`(c-fn [ptr<void> ptr<void> int float int ptr<void>] int)`

(Result int int) -- ok carries 0; err carries 0 on failure.

(let [r (stream-open a 0 2 -1 0 ":float32" 44100 512 my-cb)]
    (if (ok? r) (stream-start a) (println "stream-open failed")))

Since: RA0

defn

stream-start

(stream-start [a : Audio] :)

begin audio processing on an open stream.

aaudio handle (ok-val from audio-new)

(Result int int) -- ok carries 0; err carries 0 on failure.

(stream-start a)

Since: RA0

defn

stream-stop

(stream-stop [a : Audio] :)

stop audio processing without closing the stream.

aaudio handle (ok-val from audio-new)

void

(stream-stop a)

Since: RA0

defn

stream-close

(stream-close [a : Audio] :)

close the audio stream and release its resources.

aaudio handle (ok-val from audio-new)

void

(stream-close a)

Since: RA0

defn

stream-latency

(stream-latency [a : Audio] :)

return the stream latency in frames.

aaudio handle (ok-val from audio-new)

Latency in frames as :int.

(println (stream-latency a))

Since: RA0

defn

stream-sample-rate

(stream-sample-rate [a : Audio] :)

return the stream sample rate in Hz.

aaudio handle (ok-val from audio-new)

Sample rate as :int (e.g. 44100).

(println (stream-sample-rate a))

Since: RA0