diff options
| author | wuhei <wuhei@users.noreply.github.com> | 2026-11-19 13:43:24 +0100 |
|---|---|---|
| committer | wuhei <wuhei@users.noreply.github.com> | 2026-11-19 13:43:24 +0100 |
| commit | f5181ead5b0969fc1806fb714097b17b8d62d53b (patch) | |
| tree | d6cbbc49c2635e2f4b0028e86f92af91e9db6fc9 /README.md | |
| parent | d991dca38bd8676c2fc0fe4bc4356d62ccc8e1b1 (diff) | |
| download | lilchinese-f5181ead5b0969fc1806fb714097b17b8d62d53b.tar.gz | |
cut screen, per-sentence colour alternation, no one-character last frame
- Backspace/Delete/c in the kiosk: the screen goes red, the recogniser is reset and
the in-progress sentence is dropped, so a misheard sentence can be said again.
It returns to the normal colours as soon as the retake is heard. Under -record the
red frame also marks the retake in the video.
- colours alternate black-on-white / white-on-black at each sentence boundary.
- slide cutting no longer leaves a stub: a length break needs -preview characters to
remain, so '我自学中文已经五年了。' shows as one phrase instead of '了'.
- translation window default 40 chars (was 28): fragments cut mid-clause were
producing odd English.
- tests for slide cutting, colour flip, cut, and the sticky English line
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 33 |
1 files changed, 30 insertions, 3 deletions
@@ -46,6 +46,22 @@ everything and finalizes a recording. Then just talk. Silence holds the last phrase on screen — that is the Takahashi rhythm: one short thought per screen, replaced on the next one. +### During the talk + +| key | what it does | +|---|---| +| `Backspace` / `Delete` / `c` | **cut** — the screen goes red and the half-heard sentence is dropped so you can say it again | +| `f` | toggle fullscreen | + +The red stays up until the retake is heard, then it is back to normal colours. It is not +just a mood light: the ASR state is reset at the cut, so the flubbed sentence cannot leak +into the next one, and because the recording is a screen capture the red frame also marks +where each retake starts when you edit the video. + +Colours alternate — black on white, then white on black — at every sentence boundary +(a pause long enough for the recogniser's endpoint detector), so consecutive thoughts +read as clearly separate slides. + ## English subtitles (optional) Pass a local translation model and every phrase gets an English line underneath, @@ -76,7 +92,7 @@ How it behaves, and why: A slide lives ~0.3 s while speaking continuously — no LLM can keep up with that, so the translation lags the speaker by roughly one model call and updates as the sentence grows, like an interpreter. It never blanks between phrases. -- `-translate-window` (default 28) is how many characters of speech go to the model. +- `-translate-window` (default 40) is how many characters of speech go to the model. Larger = smoother/more context but slower; smaller = snappier, choppier fragments. - Translations are cached per phrase, so repeated words cost nothing. - Without `-translate`/`-translate-model` the page is laid out exactly as before — the @@ -97,7 +113,7 @@ How it behaves, and why: | `-wav` | off | feed an audio file (paced realtime) instead of the mic | | `-translate-model` | off | spawn llama-server with this `.gguf` for English subtitles | | `-translate` | off | use an already running OpenAI-compatible endpoint | -| `-translate-window` | `28` | characters of speech sent to the translator | +| `-translate-window` | `40` | characters of speech sent to the translator | | `-prompt` | Hy-MT template | translation prompt, `{text}` substituted | | `-llama-server` / `-llama-args` / `-llama-threads` | `llama-server` / — / half the cores | spawned backend tuning | @@ -128,7 +144,12 @@ smaller chunks, noticeably faster to emit, somewhat less accurate. ## Notes -- Slides break on `,。、;:?!…` and at `-chars`, whichever comes first. +- Slides break on `,。、;:?!…` and at `-chars`, whichever comes first — but a length + break only happens when at least `-preview` characters remain for the next phrase. Without + that rule the last frame of *我自学中文已经五年了* was just `了`, with the rest of the + sentence thrown away. Short sentences therefore stay whole. +- Slides are *not* re-split for the translator: it gets up to `-translate-window` (40) + characters of speech, starting at a clause boundary where possible. - The binary links the shared libs from the Go module cache (`rpath` → `.../pkg/mod/github.com/k2-fsa/sherpa-onnx-go-linux@v1.13.8/lib/...`). If you wipe the module cache, rebuild. @@ -136,6 +157,12 @@ smaller chunks, noticeably faster to emit, somewhat less accurate. - Recording captures the whole screen, so start it after the kiosk window is up (it auto-delays 1.5 s). +## Tests + +```sh +go test ./... # slide cutting, colour alternation, cut, sticky English, windowing +``` + ## Layout ``` |
