class

MinAudio::Capture

Inherits Reference < Object

Constructors

new(sample_rate : Int32 = 48000, channels : Int32 = 1, ring_frames : Int32 = 16384, backends : Array(Int32) | Nil = nil)

backends pins the backend list (LibMinAudio::BACKEND_*), like Engine.new — e.g. [BACKEND_OPENSL, BACKEND_AAUDIO] on Android.

Source

Instance methods

available_frames

f32-interleaved frames waiting in the ring right now (level meters, sizing the read buffer).

Source
channels
Source
close

Stop (if running) and free the device. Idempotent.

Source
closed?
Source
finalize
Source
read(buf : Bytes) : Int32

Pull up to buf.size / (channels * 4) frames of interleaved-f32 PCM into buf; returns the frame count actually read (0 = nothing captured since the last read). Never blocks.

Source
ring_frames
Source
sample_rate
Source
start
Source
stop
Source