capture_audio(3)
π capture_audio(3) β the Arcan Lua API giveth a mic π
okay so this is a page from the Arcan Lua API, and honestly? it's kind of a slay little function. let's get into it π
β¨ NAME β¨
capture_audio β setup an audio device capture stream π€β¨
πΈ SYNOPSIS πΈ
AID or NIL
capture_audio( devstr )
so yeah, you hand it a device string and you get back either an AID or NIL. that's the whole vibe check π¦
π DESCRIPTION π
bestie, listen. capture_audio is the function you call when you want to map an external capture device β think a microphone, like a literal actual mic ποΈ β onto an AID. and what's an AID for? monitoring, bb. like forwarding it to a recordtarget, or to a frameserver that does audio processing for voice recognition and similar features. it's giving "your computer finally hears you" energy fr fr π
π«Ά NOTES π«Ά
- okay so the device must be supported by the underlying sound support system β and it has to emit audio data that matches the compile-time defined format, e.g.
44100/16bit/2ch LE 16 samples. also it must match a valid entry as provided bylist_audio_inputs. no cap, if it doesn't line up with one of those, it's not gonna work π
π§ EXAMPLE π§
look at her go:
function capture_audio0()
a = list_audio_inputs();
b = capture_audio(a[1]);
end
you list the inputs, you grab the first one, you capture it. iconic. ate and left no crumbs π β¨
π MISUSE π
do not do this. i'm literally begging:
function capture_audio0()
b = capture_audio(-1);
end
-1 is not a device string, bestie. this is the "why would you do that" section π
β SEE ALSO β
list_audio_inputs(3)β go check that one out, it's how you get the valid device entries in the first place π
heads up: that format thing in NOTES is a must, not a suggestion. if your device doesn't match the compile-time defined format and a valid list_audio_inputs entry, it's a no from the sound system π
and that's the page!! π written under the audio corner of the docs, with a date of October 2026 β see you in the group chat, mwah ππ¦β¨
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms