AI auto scripture: local transcription + AI reference detection (opt-in) - #3579
AI auto scripture: local transcription + AI reference detection (opt-in)#3579josephomills wants to merge 234 commits into
Conversation
3083d2f to
f187e0c
Compare
|
Pushed a round of updates from live field testing at a conference, plus a fully-local AI option:
141 unit tests passing. The PR description's update section has the full list. |
3aca772 to
0e03d7d
Compare
|
Left a longer note on #3547 about complementary fully local streaming work I have been testing (no API keys / no LLM for the core path). Happy to collaborate or wait for maintainer preference so we do not step on this review. |
|
@AlloDel your driver is merged and wired up — engine selector in settings, resumable model download, packaging config. Thank you, the VAD choice and the Electron notes were spot on. One change to your driver, after live testing. The decoder deafness you documented goes deeper than stream reuse: any chunked feeding (fresh, reused, or persistent stream) intermittently decodes short utterances like "next verse" to nothing. The same samples in one batch acceptWaveform on a fresh stream decode correctly every time. So the driver now buffers each utterance (1s pre-roll) and batch-decodes when the VAD closes, waiting 0.5s of real tail audio first so a soft last word isn't cut mid-word. VAD retuned: threshold 0.3, min-silence 0.8s, min-speech 0.15s. If your live-testing notes contradict any of this, I'd like to know. What I'd like you to review: downloading the sherpa runtime on demand — finishing your zero-setup goal. Right now the npm natives ship in the installer (~16 MB/platform) for everyone. The plan, mirroring our ffmpeg/whisper downloaders: Exact-pin sherpa-onnx-node@1.13.4; exclude the platform packages from electron-builder, keep the JS wrapper bundled Does the sibling-layout require() hold across sherpa-onnx-node versions you've used? |
5c74a02 to
5204dc3
Compare
|
I will review this soon. But just a couple things for now I would like changed:
|
|
Alright @vassbo |
New AI_SCRIPTURE_* channels (typed in Main/ToMain), audio data filtered from IPC logging like TIMECODE_AUDIO_DATA, and the orchestrator that owns the transcriber + detection lifecycle. API keys live in the ACCESS store (non-portable, never cloud-synced) and only reach the renderer as booleans.
- whisperManager: binary/model lifecycle following the ffmpegManager pattern (Windows auto-download, system PATH probe, custom path, Hugging Face ggml model downloads with progress) - transcriber: 16kHz PCM ring buffer, RMS silence gate, 7s windows with 1s overlap, whisper-cli per window or persistent whisper-server, noise/low-confidence segment filtering - detection: tier-1 local reference matching (spoken word-numbers, ordinal book prefixes, cue-gated confidence) and tier-2 LLM detection with dedupe, cooldowns and single-flight scheduling - providers: Anthropic / OpenAI / Gemini over plain REST (axios) with structured JSON output, normalized error codes and key test calls - 66 colocated vitest tests
AudioWorklet mirrors the LTC timecode listener (48k to 16k mono Int16, 1s chunks over IPC). The dispatcher validates detections against the selected bibles (collection-aware), verifies quoted verses against actual verse text across translations, clamps ranges, and projects via activeScripture + playScripture so outLocked, history and templates all apply. Auto mode is confidence-gated with a min-display queue, and a manual override watcher pauses auto-projection whenever the operator changes the output slide themselves.
Collapsible panel in the scripture drawer with live transcript view and one-click suggestion cards; setup popup covering whisper install per platform (with custom binary and model paths), provider API keys with test, search-bible multi-select with select all, display translation and behavior settings. Feature is off by default behind a toggle in Settings > Other with a persistent privacy note.
|
Since the last update — bubble & scripture polish
AI in Quick Search The palette (Ctrl+G) has a new AI category — its own group header,
The entries keep a fixed order, and reopening the palette re-runs the search so the All 373 AI tests stay green, and the svelte-check/lint baselines are unchanged. @vassbo I'll pause here and wait for you to have a look at it so we know the way forward. Thank you! |
# Conflicts: # src/types/IPC/Main.ts
|
@josephomills The plan is to review this soon, and get it merged as a hidden/experimental feature before the next beta release in a few weeks. |
|
Great! Looking forward to a lot of feedback from different speakers/preachers, different languages & different computers. I'm also looking up ways to simplify this feature: |
What
AI auto scripture (opt-in, off by default): FreeShow listens to the sermon, transcribes locally with whisper.cpp, detects scripture references — both spoken ("John chapter 3 verse 16", instant local matching) and quoted ("for God so loved the world…", via a bring-your-own-key LLM) — and either projects them automatically or offers one-click suggestion cards in the scripture drawer.
https://github.com/ChurchApps/FreeShow — demo video to follow.
Features
Guarantees (please review these first)
safeStoragefollow-upPlatform matrix
brew install whisper-cppdetection or custom pathTesting
Happy to split, adjust scope, or rework anything — I kept every touched upstream file minimal and matched existing patterns (LTC worklet, ffmpegManager, ACCESS store, Material inputs, i18n) throughout.
Updates since opening
Test suite is now at 141.