Repository navigation
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
Conversation
nyosegawa
changed the base branch from
server-vad-commits-at-silence
to
main
November 21, 2026 20:40
…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
force-pushed
the
server-vad-recognizes-before-commit
branch
from
November 21, 2026 20:41
5ac5a2d to
5379afd
Compare
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>
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #232, now merged. Closes #230.
What changed
speech_detection_ending(detection, &end)says whether the speech of the regionspeech_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_msbelow twicespeech_pad_ms) while no region has begun after it.speech asr -vreports, 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.pyon 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/realtimewithserver_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 tocompleted: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 detectwith Silero VAD on the CPU and on Metal: pass, with its new check that every region given before the end had its end said byspeech_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 formin_silence_duration_ms0 andspeech_pad_ms100.server_realtime_smoke.py,server_smoke.py,server_diarization_smoke.py,server_enhancement_smoke.py,server_page_smoke.pyandserver_dialogue_smoke.py;speech_cli_smoke.pywith Qwen3-ASR 0.6B and with reazonspeech-nemo-v2 F32: pass.speech-api-checkwith Qwen3-TTS 0.6B and Irodori-TTS v4.1-Small-MF,transcribewith reazonspeech-nemo-v2 F32,enhancewith RE-USE,dialoguewith Haru 4B;worker_smoke.pywith Qwen3-TTS and Irodori-TTS,worker_recognition_smoke.pywith Qwen3-ASR 0.6B and reazonspeech-nemo-v2,worker_enhancement_smoke.py,worker_dialogue_smoke.py: pass.wasm_browser_smoke.mjswith Silero VAD on the module without threads and with--threads 4on the module with them, built with emsdk 7.0.0: pass.Not run:
speech-api-check transcribewith 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