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.

OptionTypeDefaultRange
sample_rateinteger160008,000–48,000 Hz
channelsinteger11 or 2
max_secondsinteger201–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.

On this page