Skip to content

Read an utterance to the end it would take while the silence that ends it goes on, and let its commit take that reading - #233

Merged
nyosegawa merged 2 commits into
mainfrom
server-vad-recognizes-before-commit
Nov 21, 2026
Merged

nyosegawa merged 2 commits into
mainfrom
server-vad-recognizes-before-commit

Conversation

@nyosegawa

@nyosegawa nyosegawa commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Builds on #232, now merged. Closes #230.

What changed

  • C API 4.3: speech_detection_ending(detection, &end) says whether the speech of the region speech_detection_speaking() reports has stopped, and the end it is given with if no speech starts again: for the region under way once its probability has fallen below the threshold less 0.15 and it is long enough to be given there, and for a region whose end waits on what follows (min_silence_duration_ms below twice speech_pad_ms) while no region has begun after it.
  • Live transcription reads an utterance to the end it would take while the silence that ends it goes on, and its commit takes that reading. Once the detection says the speech has stopped, one reading reads the utterance to the end its region takes if the silence lasts, its padding included, as soon as that audio is there, and no reading reads the silence after it. A commit of a region of the same samples completes with that reading's text in place of a recognition of its own: the samples, the request and the draft are those the commit's recognition would have had. Where speech starts again, it is a reading like any other. An utterance enhanced before its recognition is still recognized after its commit.
  • speech asr -v reports, for an utterance completed by that reading, the reading's time.

With #232's padding, a region's audio is all there once the silence has lasted the padding it keeps after the speech (300 ms with the defaults), and it is committed once the silence has lasted silence_duration_ms (500 ms): the recognition now runs in those 200 ms.

This is the idea of #230, in a shape that needs no recognition thrown away: the reading that runs during the silence takes a reading's place, which would otherwise read the silence.

Measured

measure/live_latency.py on an Apple M5 (2026-11-22): FLEURS ja_jp and en_us test clips, two sessions of five clips per language in each of two rounds, over /v1/realtime with server_vad's defaults in pieces of 100 ms in real time, Qwen3-ASR Q8_0 on Metal and Silero VAD on the CPU. Utterances the detection did not cut, p50 / p90 in seconds from the end of speech to completed:

0.11.0 #232 this PR
0.6B en 0.80 / 1.00 0.69 / 0.82 0.59 / 0.69
0.6B ja 0.79 / 0.84 0.73 / 0.83 0.58 / 0.64
1.7B en 0.96 / 1.08 0.85 / 1.01 0.62 / 0.78
1.7B ja 1.00 / 1.16 0.84 / 0.98 0.66 / 0.72

The commit came 0.58–0.60 s after the speech in the median with #232 and this PR alike (0.67–0.69 s on 0.11.0): with the 0.6B model the transcript now completes as the utterance is committed. Every completed transcript (58 per model and build) was the recognition of the same samples sent as a file afterwards. Peak memory unchanged.

Checked

  • speech-api-check detect with Silero VAD on the CPU and on Metal: pass, with its new check that every region given before the end had its end said by speech_detection_ending() before it was given. With the ending of a region whose end waits left out (as Realtime transcription: recognize an utterance while the silence that ends it goes on, so that completed comes as it is committed #230's prototype had it), the check fails for min_silence_duration_ms 0 and speech_pad_ms 100.
  • server_realtime_smoke.py, server_smoke.py, server_diarization_smoke.py, server_enhancement_smoke.py, server_page_smoke.py and server_dialogue_smoke.py; speech_cli_smoke.py with Qwen3-ASR 0.6B and with reazonspeech-nemo-v2 F32: pass.
  • speech-api-check with Qwen3-TTS 0.6B and Irodori-TTS v4.1-Small-MF, transcribe with reazonspeech-nemo-v2 F32, enhance with RE-USE, dialogue with Haru 4B; worker_smoke.py with Qwen3-TTS and Irodori-TTS, worker_recognition_smoke.py with Qwen3-ASR 0.6B and reazonspeech-nemo-v2, worker_enhancement_smoke.py, worker_dialogue_smoke.py: pass.
  • wasm_browser_smoke.mjs with Silero VAD on the module without threads and with --threads 4 on the module with them, built with emsdk 7.0.0: pass.

Not run: speech-api-check transcribe with Qwen3-ASR, which needs F16 or F32 weights this machine does not hold; Drama 3, whose synthesis this change does not touch; Windows / Vulkan, as the change runs on the CPU alone.

🤖 Generated with Claude Code

nyosegawa and others added 2 commits November 22, 2026 05:41
…s it goes on, and let its commit take that reading

speech_detection_ending() (C API 4.3) says whether the speech of the region speech_detection_speaking()
reports has stopped, and the end it is given with if no speech starts again: for the region under
way once its probability has fallen below the threshold less 0.15 and it is long enough to be given
there, and for a region whose end waits on what follows while no region has begun after it.

The assembly of utterances asks it after each piece. Once the speech of the utterance under way has
stopped, one reading reads the utterance to the end its region takes if the silence lasts, its
padding included, as soon as that audio is there, and no reading reads the silence after it. A
commit of a region of the same samples completes with that reading's text in place of a
recognition of its own: the samples, the request and the draft are those its recognition would
have had. Where speech starts again, the reading is a reading like any other. An utterance enhanced
before its recognition is still recognized after its commit. speech asr -v reports, for an
utterance completed so, the reading's time.

Checked: speech-api-check detect with Silero VAD on the CPU and on Metal passes, with its new check
that every region given before the end had its end said by speech_detection_ending(); with the
ending of a region whose end waits left out, as #230's prototype had it, that check fails for
min_silence_duration_ms 0 and speech_pad_ms 100.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
measure/live_latency.py on an Apple M5 with FLEURS ja and en over /v1/realtime: the completed
transcript came 0.58 to 0.59 s after the speech ended in the median with Qwen3-ASR 0.6B, as the
utterance was committed, and 0.62 to 0.66 s with 1.7B, where the tools' padding alone gave 0.69 to
0.73 s and 0.84 to 0.85 s. Every completed transcript was the recognition of the same samples sent
as a file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nyosegawa
nyosegawa force-pushed the server-vad-recognizes-before-commit branch from 5ac5a2d to 5379afd Compare November 21, 2026 20:41
@nyosegawa
nyosegawa merged commit e32e04b into main Nov 21, 2026
8 checks passed
nyosegawa added a commit that referenced this pull request Nov 21, 2026
…_ms has passed and recognized while that silence goes on (#234)

VERSION is 0.11.2, and the docs that name the version say so: speech --version (now with C API
4.3), the notice of a newer release, speech_version() and the worker's ready.

0.11.2 carries #232, which pads the regions of transcription by regions in the tools so that an
utterance is committed once silence_duration_ms of silence has followed its speech (500 ms with
OpenAI's defaults, where Silero VAD's padding waited 600 ms), and #233, which adds
speech_detection_ending() (C API 4.3) and reads an utterance to the end it would take while that
silence goes on, so that its commit completes with that reading. On an Apple M5 over /v1/realtime,
the median time from the end of speech to the completed transcript went from 0.79-0.80 s to
0.58-0.59 s with Qwen3-ASR 0.6B and from 0.96-1.00 s to 0.62-0.66 s with 1.7B.

Checked: no file other than VERSION and the four docs names the release or the C API's version.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@nyosegawa
nyosegawa deleted the server-vad-recognizes-before-commit branch November 21, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Realtime transcription: recognize an utterance while the silence that ends it goes on, so that completed comes as it is committed

1 participant