<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lilchinese, branch main</title>
<subtitle>lilchinese — live 高橋メソッド subtitles for spoken Chinese (local ASR, optional local MT)
</subtitle>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/'/>
<entry>
<title>README: clone URL of the public mirror</title>
<updated>2026-11-20T15:18:38+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-20T15:18:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=48d202eb47290ab5a846feb9992222b9f8d0cdf6'/>
<id>48d202eb47290ab5a846feb9992222b9f8d0cdf6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>prepare for publication: MIT licence, no bundled third-party photo, tighter ignores</title>
<updated>2026-11-20T14:49:14+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-20T14:49:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=07ac2567dab0041ced22fde8fafbd4c7ae90da0e'/>
<id>07ac2567dab0041ced22fde8fafbd4c7ae90da0e</id>
<content type='text'>
- the intro picture was press photography from a news site; it is no longer tracked
  (web/intro.jpg is gitignored) and scripts/fetch-intro.sh installs your own. The page
  drops the &lt;img&gt; if it 404s, so a fresh clone is just the red field and the title.
- .gitignore now covers recorder output (mp4/mkv/webm/mov/m4v), the media files that
  land in the working directory during a talk (*.png/*.jpg/*.wav/*.mp3), models and
  session logs, so 'git add -A' cannot sweep them into a commit.
- LICENSE: MIT for the code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- the intro picture was press photography from a news site; it is no longer tracked
  (web/intro.jpg is gitignored) and scripts/fetch-intro.sh installs your own. The page
  drops the &lt;img&gt; if it 404s, so a fresh clone is just the red field and the title.
- .gitignore now covers recorder output (mp4/mkv/webm/mov/m4v), the media files that
  land in the working directory during a talk (*.png/*.jpg/*.wav/*.mp3), models and
  session logs, so 'git add -A' cannot sweep them into a commit.
- LICENSE: MIT for the code.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: brokers now start behind the intro gate</title>
<updated>2026-11-19T19:47:32+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-19T19:47:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=6f9aaf04904a5b1d455fae358d3f88cc1e5384ee'/>
<id>6f9aaf04904a5b1d455fae358d3f88cc1e5384ee</id>
<content type='text'>
Publishing is gated on the intro being dismissed, so a plain newBroker() is silent
and the colour-alternation test hung. Use a started broker in tests, and cover the
gate itself (nothing published before /start, first slide after it carries start).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Publishing is gated on the intro being dismissed, so a plain newBroker() is silent
and the colour-alternation test hung. Use a started broker in tests, and cover the
gate itself (nothing published before /start, first slide after it carries start).
</pre>
</div>
</content>
</entry>
<entry>
<title>intro page: red title slide with photo, 批斗大会 / STRUGGLE SESSION</title>
<updated>2026-11-19T19:27:10+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-19T19:27:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=c547e022535c86de6ca98f626abbb66c4bbd96b2'/>
<id>c547e022535c86de6ca98f626abbb66c4bbd96b2</id>
<content type='text'>
- served from the embedded web dir (http.FileServer over the go:embed FS), so the
  binary is still self-contained
- nothing is published to the display until Enter: the broker gates every broadcast on
  a started flag, and /start also resets the recogniser so room noise during setup
  cannot leak into the first slide
- /config hands the page the intro strings, whether translation is on, and whether the
  intro was already dismissed (so a reload mid-talk skips it)
- -intro=false, -intro-zh, -intro-en, -intro-image to tune or skip it
- web/intro.jpg is third-party press photography (secretchina.com), bundled for
  convenience, not covered by this project's licence
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- served from the embedded web dir (http.FileServer over the go:embed FS), so the
  binary is still self-contained
- nothing is published to the display until Enter: the broker gates every broadcast on
  a started flag, and /start also resets the recogniser so room noise during setup
  cannot leak into the first slide
- /config hands the page the intro strings, whether translation is on, and whether the
  intro was already dismissed (so a reload mid-talk skips it)
- -intro=false, -intro-zh, -intro-en, -intro-image to tune or skip it
- web/intro.jpg is third-party press photography (secretchina.com), bundled for
  convenience, not covered by this project's licence
</pre>
</div>
</content>
</entry>
<entry>
<title>settle short sentences on screen when the speaker pauses</title>
<updated>2026-11-19T18:29:21+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-19T18:29:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=78455c67406808fc1da9f8655708738f10e30d23'/>
<id>78455c67406808fc1da9f8655708738f10e30d23</id>
<content type='text'>
A long sentence flipped through fragments and stopped on the last one: '我觉得今年
我的中文会说得好一些。' ended up on screen as '会说得好一些'. The frame that stays
up is also the frame that gets recorded, translated and logged, so it has to be the
whole sentence.

- -settle (default 20): at an endpoint, if the finished sentence is that short, it is
  published whole and replaces the trailing fragment. Fragments still flip while you
  speak, so the Takahashi rhythm is unchanged; -settle 0 restores it exactly.
- the fragment is no longer published for a sentence that is about to settle (one
  look, not two), so there is no flash of a frame that is immediately replaced.
- tests: settles whole, long sentences still fragment, -settle 0 keeps fragments
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A long sentence flipped through fragments and stopped on the last one: '我觉得今年
我的中文会说得好一些。' ended up on screen as '会说得好一些'. The frame that stays
up is also the frame that gets recorded, translated and logged, so it has to be the
whole sentence.

- -settle (default 20): at an endpoint, if the finished sentence is that short, it is
  published whole and replaces the trailing fragment. Fragments still flip while you
  speak, so the Takahashi rhythm is unchanged; -settle 0 restores it exactly.
- the fragment is no longer published for a sentence that is about to settle (one
  look, not two), so there is no flash of a frame that is immediately replaced.
- tests: settles whole, long sentences still fragment, -settle 0 keeps fragments
</pre>
</div>
</content>
</entry>
<entry>
<title>Enter keeps the sentence: green on screen, appended to a session log</title>
<updated>2026-11-19T17:36:43+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-19T17:36:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=b457d19d9b2c634570300d0f73087e18b4ec4a4a'/>
<id>b457d19d9b2c634570300d0f73087e18b4ec4a4a</id>
<content type='text'>
- Enter (kiosk) turns the sentence green and appends it to a Markdown session log,
  default sessions/session-&lt;timestamp&gt;.md, -log to override. Written lazily, so a
  run that kept nothing leaves no file.
- logs the whole sentence rather than the 9 characters on screen; the snapshot waits
  450ms so the model's lookahead has decoded the final syllables
- the English in the log is a fresh translation of that sentence, done on a single
  ordered worker off the audio path, so it never delays recognition
- green clears with the next sentence, like the red cut screen
- double Enter within 2s does not duplicate a line
- tests: keep state, sentence selection, log format and dedupe
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Enter (kiosk) turns the sentence green and appends it to a Markdown session log,
  default sessions/session-&lt;timestamp&gt;.md, -log to override. Written lazily, so a
  run that kept nothing leaves no file.
- logs the whole sentence rather than the 9 characters on screen; the snapshot waits
  450ms so the model's lookahead has decoded the final syllables
- the English in the log is a fresh translation of that sentence, done on a single
  ordered worker off the audio path, so it never delays recognition
- green clears with the next sentence, like the red cut screen
- double Enter within 2s does not duplicate a line
- tests: keep state, sentence selection, log format and dedupe
</pre>
</div>
</content>
</entry>
<entry>
<title>cut screen, per-sentence colour alternation, no one-character last frame</title>
<updated>2026-11-19T12:43:24+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-19T12:43:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=f5181ead5b0969fc1806fb714097b17b8d62d53b'/>
<id>f5181ead5b0969fc1806fb714097b17b8d62d53b</id>
<content type='text'>
- 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- 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
</pre>
</div>
</content>
</entry>
<entry>
<title>recorder: run ffmpeg and the audio source in their own process group</title>
<updated>2026-11-19T11:43:33+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-19T11:43:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=d991dca38bd8676c2fc0fe4bc4356d62ccc8e1b1'/>
<id>d991dca38bd8676c2fc0fe4bc4356d62ccc8e1b1</id>
<content type='text'>
A terminal Ctrl+C signals the whole foreground process group, so ffmpeg got a
second SIGINT while it was writing the mp4 trailer and truncated the file
('moov atom not found'). Setpgid keeps our single SIGINT the only one.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A terminal Ctrl+C signals the whole foreground process group, so ffmpeg got a
second SIGINT while it was writing the mp4 trailer and truncated the file
('moov atom not found'). Setpgid keeps our single SIGINT the only one.
</pre>
</div>
</content>
</entry>
<entry>
<title>english subtitles from a local translation model</title>
<updated>2026-11-19T11:38:24+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-19T11:38:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=a5b77eb48974cfae45bac65ceb4880752444eb47'/>
<id>a5b77eb48974cfae45bac65ceb4880752444eb47</id>
<content type='text'>
Optional second line under the Chinese, translated on the machine:

- -translate-model spawns llama-server (free port, /health wait, SIGTERM on exit)
  and uses Hy-MT2-1.8B (Tencent Hunyuan MT) — a dedicated zh→en model, 30 tok/s
  on CPU, so a phrase lands in 0.5-0.8s
- -translate points at an already running OpenAI-compatible endpoint (ollama,
  LM Studio, llama-server)
- the English line is sticky rather than tied to the 9 characters on screen: no
  LLM can keep up with a slide that lives 0.3s, so the translation lags by about
  one model call and never blanks between phrases
- -translate-window (28 chars) trades context for latency; translations cached
- phrase text is debounced 200ms and coalesced latest-wins so growth does not
  queue up dozens of requests
- display reserves the English line only when translation is enabled, so the
  Chinese layout is unchanged without it; autofit now fits both lines
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Optional second line under the Chinese, translated on the machine:

- -translate-model spawns llama-server (free port, /health wait, SIGTERM on exit)
  and uses Hy-MT2-1.8B (Tencent Hunyuan MT) — a dedicated zh→en model, 30 tok/s
  on CPU, so a phrase lands in 0.5-0.8s
- -translate points at an already running OpenAI-compatible endpoint (ollama,
  LM Studio, llama-server)
- the English line is sticky rather than tied to the 9 characters on screen: no
  LLM can keep up with a slide that lives 0.3s, so the translation lags by about
  one model call and never blanks between phrases
- -translate-window (28 chars) trades context for latency; translations cached
- phrase text is debounced 200ms and coalesced latest-wins so growth does not
  queue up dozens of requests
- display reserves the English line only when translation is enabled, so the
  Chinese layout is unchanged without it; autofit now fits both lines
</pre>
</div>
</content>
</entry>
<entry>
<title>lilchinese: local streaming Chinese ASR rendered as fullscreen Takahashi slides</title>
<updated>2026-11-19T10:54:17+00:00</updated>
<author>
<name>wuhei</name>
<email>wuhei@users.noreply.github.com</email>
</author>
<published>2026-11-19T10:54:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.tomcooks.com/lilchinese/commit/?id=10ee627143419d6e9c9186fbb0a023a34b08948e'/>
<id>10ee627143419d6e9c9186fbb0a023a34b08948e</id>
<content type='text'>
parec mic -&gt; sherpa-onnx streaming zipformer (zh, int8, offline) -&gt; slide
splitter -&gt; SSE -&gt; Firefox kiosk. No cloud, no Web Speech API.

- 20ms audio reads, ~35ms capture-to-paint overhead, 320ms model lookahead
- slides break on punctuation or at -chars; short tails don't blank a full slide
- autofit font (Noto Sans CJK SC Black), 90ms slam transition, SSE reconnect
- -record captures screen+mic via ffmpeg x11grab+pulse, finalized on Ctrl+C
- -wav plays a file through the pipeline for testing
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
parec mic -&gt; sherpa-onnx streaming zipformer (zh, int8, offline) -&gt; slide
splitter -&gt; SSE -&gt; Firefox kiosk. No cloud, no Web Speech API.

- 20ms audio reads, ~35ms capture-to-paint overhead, 320ms model lookahead
- slides break on punctuation or at -chars; short tails don't blank a full slide
- autofit font (Noto Sans CJK SC Black), 90ms slam transition, SSE reconnect
- -record captures screen+mic via ffmpeg x11grab+pulse, finalized on Ctrl+C
- -wav plays a file through the pipeline for testing
</pre>
</div>
</content>
</entry>
</feed>
