microphone.start
Start recording from the default Windows microphone.
Syntax
ue.microphone.start(options?: table) -> integer, string?This function requires a persistent session and returns a capture ID.
| Option | Type | Default | Range |
|---|---|---|---|
sample_rate | integer | 16000 | 8,000–48,000 Hz |
channels | integer | 1 | 1 or 2 |
max_seconds | integer | 20 | 1–30 seconds |
local capture_id, err = ue.microphone.start({
sample_rate = 16000,
channels = 1,
max_seconds = 20
})
assert(capture_id, err)Only one capture can be active across all Lua sessions. The maximum duration is enforced even if microphone.stop has not been called.