Skip to content

mac-captions: add on-device live captions filter - #84

Draft
chriscoveries wants to merge 4 commits into
masterfrom
captions/c1-mac-filter
Draft

chriscoveries wants to merge 4 commits into
masterfrom
captions/c1-mac-filter

Conversation

@chriscoveries

@chriscoveries chriscoveries commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Problem

The en-US model was available only after AssetInventory.reserve(locale:); a fresh process could report supported before the active filter had reserved the locale. The initial real-speech test skipped on that status, and the filter could not use the model in its own process.

Root cause

The active SpeechSession checked AssetInventory.status(forModules:) without first reserving its selected locale. Reserving en-US changes the in-process status to installed; assetInstallationRequest(supporting:) may then return nil because no installation request is needed.

Fix

The active speech session now reserves its selected locale and releases it when recognition stops. It never requests or installs assets. A separate standalone installer contains the reserve-before-request flow and requires the explicit --install-en-us-speech-assets flag. The headless real-speech test now feeds the LibriVox fixture through the filter core and decodes the output queue's CEA-608 triplets.

Evidence

  • Original tests-only RED: ec54c9088; filter and fake-transcriber GREEN: 6b7910d6a.
  • Follow-up: e50d7167d.
  • macOS 27 arm64 real-speech test: 1,440,000 fixture frames (30.0 s), 177 CEA-608 packets, 43 recognized words vs. 46 reference words, WER 15.2% (7/46 word errors).
  • Decoded 608 output: “This is a Librivox recording. All Librivox recordings are in the public domain. For more information, and to find out how you can volunteer, please visit Librivox.org. Recording by Peter Yearsley. Abu Benadem, by Leigh Hunt. Abu Benadim, may his tribe increase.”
  • The single previously authorized reservation/request attempt returned true for reserve and nil for the request; status afterward was installed. The standalone installer was built and, without its opt-in flag, printed usage and exited 64. It was not invoked with the installation flag again.

Compatibility & risk

No public C headers or APIs changed. The filter reserves the en-US locale only while its recognizer is active; disabling it stops recognition and releases its reservation. Asset installation remains a separate explicit action. No microphone or GUI access is used.

How this was tested

  • Focused Xcode Debug build of test_mac_captions and mac-captions-install-speech-assets: passed.
  • ctest --test-dir build/c1-xcode -C Debug -R '^test_mac_captions$' --verbose: passed both CMocka cases; the real file-fed path reported the WER and decoded text above.
  • Installer invocation without --install-en-us-speech-assets: exit 64 with usage text; no asset request or installation was triggered.
  • CI was not dispatched under the owner's CI-off order. There is no CI run URL yet; CI remains pending.

Status

Draft; local macOS verification is complete. CI remains pending until the owner resumes it.


Thank you to the obs-rust maintainers and contributors for building this project in the open. In the American spirit of free expression and individual independence, and with the principle of judging contributions on their merit alone, this PR is a small piece of what independent people can build when they come together.

@chriscoveries
chriscoveries force-pushed the captions/c1-mac-filter branch from 895d0b8 to e50d716 Compare October 15, 2026 20:46
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.

1 participant