@@ -98,8 +98,9 @@ nil and the failure reason, while the value-only `readInto` raises that reason.
9898stream; destroy it and open a new microphone. Native capture supports one to
9999eight channels. The public argument range remains one to 32 for compatibility;
100100a valid request above eight returns an operational refusal from the native
101- opener. Full device-enumeration change notifications remain deferred. Listing
102- current devices and observing failure of an active stream do not depend on them.
101+ opener. Device enumeration is snapshot-only and provides no change
102+ notifications. Listing devices and observing failure of an active stream do not
103+ depend on notifications.
103104]]
104105
105106local audiobackend = require("tecs.platform.audiobackend")
@@ -135,10 +136,8 @@ local DEFAULT_CAPTURE_FREQUENCY: integer = 48000
135136--- microphone is one microphone and a game that wants a stereo pair asks.
136137local DEFAULT_CAPTURE_CHANNELS: integer = 1
137138
138- --- Channels a microphone may be asked for. The ceiling is the one the SDL
139- --- implementation published, and its refusal message is a compatibility
140- --- surface, so it stays where it was even though the capture path itself
141- --- carries fewer.
139+ --- Channels a microphone may be asked for. The public compatibility contract
140+ --- accepts up to 32 even though the native capture path carries fewer.
142141local MAX_CAPTURE_CHANNELS: integer = 32
143142
144143--- Slots a voice handle reserves for its index. The rest of the handle is a
659658--- Names one physical audio device.
660659---
661660--- Re-exported from the backend contract so a game reaches it as
662- --- `tecs.audio.Device`, which is where the SDL implementation published it .
661+ --- `tecs.audio.Device`.
663662export type Device = audiobackend.Device
664663
665664--- Configures `openMicrophone`.
@@ -706,11 +705,9 @@ export type MicrophoneConfig = {
706705--- machine never created, so the frames cross by this side emptying a buffer
707706--- rather than by anything calling in.
708707---
709- --- The buffer is bounded, which is the one behavior the SDL implementation had
710- --- and this does not. SDL grew its capture stream without limit, so a game that
711- --- stopped reading paid in memory and in latency forever. This drops the oldest
712- --- frames instead and counts them in `overruns`, because the recent second is
713- --- what a game that fell behind actually wants.
708+ --- The buffer is bounded. When a game stops reading, capture drops the oldest
709+ --- frames and counts them in `overruns`, preserving the most recent audio
710+ --- without unbounded memory or latency growth.
714711export record Microphone
715712 --- Read-only. Reports the frames per second `read` answers in. This is the
716713 --- requested value, not the device's own.
0 commit comments