VAD docs: startup buffer latency stated precisely; smoke-voice-vad --exe

This commit is contained in:
omar committed 2026-10-24 09:31:27 +03:00
1 parent b7951e0693
commit 9adf5496b2
5 files changed
+18 -9

No files matched your search

+3 -2
View File
@@ -7,8 +7,9 @@
the earshot voice detector (a small embedded neural network, no cloud service, no speech recognition) on
audio that has already passed the microphone processing (noise suppression, echo cancellation, gain
control). It sends from about 100 ms before a detected onset until about 400 ms after the last detected
speech; right after connecting, unmuting or changing the mode every frame since then is kept, so the first
word is sent in full (about 200 ms later). Muting, deafening, disconnecting, a channel or codec change and
speech. After connecting, unmuting or changing the mode the gate cannot open for 200 ms, but every frame
since then is kept (up to 300 ms) and sent with the first spurt, so the first word is complete; that first
spurt therefore starts up to 300 ms late (later spurts carry the normal 100 ms). Muting, deafening, disconnecting, a channel or codec change and
a server talk denial discard what the detector heard. Push to talk and the open microphone are unchanged;
stored settings keep their mode, and new profiles still start with push to talk.
- The transmission mode moved from Settings → Keyboard to Settings → Audio; the push-to-talk key stays in
+2 -1
View File
@@ -63,7 +63,8 @@ attached with a `local` designation and a `*-build-info.txt` provenance file.
header. The key works **only while the TeamsPeach window is focused**; the header hint says so.
- **Voice activation**: a small voice detector built into TeamsPeach decides on this computer when you
are speaking and sends only then, from about 0.1 s before a detected word until about 0.4 s after the
last detected speech. Sensitivity: High (quieter speech), Normal, Low (noisier surroundings). It runs
last detected speech (the first spurt after connecting, unmuting or changing the mode carries up to
0.3 s of held audio and so starts up to 0.3 s late). Sensitivity: High (quieter speech), Normal, Low (noisier surroundings). It runs
after the microphone processing in the same panel (noise suppression, echo cancellation, gain
control). It is not speech recognition and saves nothing; loud speech-like sound (TV, other voices)
can also trigger it.
+2 -1
View File
@@ -223,7 +223,8 @@ probability 0–1). The gate opens after 3 consecutive windows at or above the t
(`high` 0.45, `normal` 0.6 — default, `low` 0.75) and sends the 5 frames (100 ms) held before
the onset, then the current frame. While open, a window counts as voiced down to 0.15 below the
threshold; the gate closes 20 frames (400 ms) after the last voiced frame. It cannot open
during the first 10 frames after a reset. Detector, filter history and preroll are reset on
during the first 10 frames after a reset; until the first spurt after a reset all frames since it are held
(at most 15 = 300 ms) and sent before the current one, later spurts send 5. Detector, filter history and preroll are reset on
every `set_transmit`, `audio_end`, mute/deafen, disconnect, channel or codec change and when
the server does not allow talking. `sensitivity` is accepted only with `vad`.
Before answering, the core discards frames still queued from the previous mode and ends any
+7 -3
View File
@@ -46,9 +46,13 @@ Noise: generated in the tests (synthetic, not recordings).
| 160 ms pause inside speech | one spurt (not split) |
| End of speech | closes 23–26 frames (460–520 ms) after the last speech frame of the fixture |
Added latency: within a spurt none (frames are sent as they arrive). At an onset the preroll (100 ms) goes
out at once, so the receiver plays the spurt from up to ~100 ms before the decision; the decision itself comes
0–60 ms after the first loud frame. Right after a reset the first spurt is up to ~260 ms late.
Added latency: within a spurt none (frames are sent as they arrive). At an onset the held frames go out at
once, so the receiver plays the spurt from before the decision: normally 100 ms (5 frames); the decision itself
comes 0–60 ms after the first loud frame. After a reset the held buffer is up to 300 ms (15 frames) until the
first spurt: speech at frame 0 opens the gate at frame 10 (200 ms) and sends frames 0–10; if the user is silent
for longer, the buffer stays full with the last 300 ms and the first speech flushes all 15 frames, so that
first spurt starts up to 300 ms late. Every later spurt carries 100 ms. This is buffered PCM, not zero added
latency.
ARM64: the same unit tests run in CI under qemu-aarch64 (emulated); native Apple Silicon/Asahi hardware is not
tested.
+4 -2
View File
@@ -4,7 +4,7 @@
// Everything after getUserMedia is the real path (capture processing, worklet, IPC, core voice detector,
// Opus, server, B's decoder). B listens at zero playback gain and never transmits.
//
// node scripts/smoke-voice-vad.mjs --server 10.10.10.160:9987 --out docs/evidence/runtime/<name>
// node scripts/smoke-voice-vad.mjs --server 10.10.10.160:9987 --out docs/evidence/runtime/<name> [--exe packaged.exe]
//
// Refuses to run if anyone else is in the channel. Not an official-client interoperability test.
import { launchApp } from './lib/electron-app.mjs';
@@ -22,6 +22,7 @@ if (!server) {
process.exit(2);
}
const out = path.resolve(root, opt('out', 'smoke-vad-out'));
const exe = opt('exe');
mkdirSync(out, { recursive: true });
const result = { startedAt: new Date().toISOString(), server, steps: [], console: [] };
const step = (name, data = {}) => {
@@ -57,7 +58,7 @@ const inputWav = path.join(work, 'speech-loop.wav');
const input = buildInput(inputWav);
async function launch(label, nickname, args, profile = mkdtempSync(path.join(tmpdir(), `teamspeach-${label}-`))) {
const app = await launchApp({ profile, args: ['--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream', ...args] });
const app = await launchApp({ exe, profile, args: ['--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream', ...args] });
const page = await app.firstWindow();
page.on('console', (m) => result.console.push(`${label} ${m.type()}: ${m.text()}`));
page.on('pageerror', (e) => result.console.push(`${label} pageerror: ${e.message}`));
@@ -122,6 +123,7 @@ let a;
let b;
let failed = null;
try {
step('build', { exe: exe ? path.basename(exe) : 'dev tree' });
step('input', { file: 'silence 2 s + speech-librivox-48k.wav (4 s) + silence 3 s, looped', seconds: input.seconds });
a = await launch('A', 'PeachVadA', [`--use-file-for-fake-audio-capture=${inputWav}`]);
b = await launch('B', 'PeachVadB', []);