Compare commits
3 commits
c912ff371f
...
7a64011810
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a64011810 | |||
|
|
4092f91318 | ||
|
|
7170a7d96c |
12 changed files with 170 additions and 40 deletions
33
.forgejo/workflows/release.yml
Normal file
33
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
# The release installer, built path-free on a Windows runner. Run by hand only; the artifact is
|
||||||
|
# scanned with the private term list before it is attached to a release, never from here.
|
||||||
|
name: release
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
ref:
|
||||||
|
description: Commit or tag to build
|
||||||
|
required: true
|
||||||
|
default: master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
windows:
|
||||||
|
runs-on: windows
|
||||||
|
timeout-minutes: 90
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
# Git Bash by its path: the runner service's PATH need not hold it.
|
||||||
|
shell: '"C:\\Program Files\\Git\\bin\\bash.exe" --noprofile --norc -eo pipefail {0}'
|
||||||
|
steps:
|
||||||
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.ref }}
|
||||||
|
- name: Build the installer, path-free
|
||||||
|
run: |
|
||||||
|
bun install
|
||||||
|
bunx waybetter@0.7.0 build-env --root "$PWD" -- bun run app:build
|
||||||
|
ls -l target/release/bundle/nsis/
|
||||||
|
- uses: https://code.forgejo.org/actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: installer
|
||||||
|
if-no-files-found: error
|
||||||
|
path: target/release/bundle/nsis/*-setup.exe
|
||||||
4
Cargo.lock
generated
4
Cargo.lock
generated
|
|
@ -3111,7 +3111,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "prompt-core"
|
name = "prompt-core"
|
||||||
version = "1.2.0"
|
version = "1.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
|
|
@ -4396,7 +4396,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "textream"
|
name = "textream"
|
||||||
version = "1.2.0"
|
version = "1.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cpal",
|
"cpal",
|
||||||
"prompt-core",
|
"prompt-core",
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@ members = ["crates/prompt-core", "src-tauri"]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "1.2.0"
|
version = "1.3.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.80"
|
rust-version = "1.80"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["CRTkafa"]
|
authors = ["CRTkafa", "Emrah"]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
unicode-segmentation = "1.12"
|
unicode-segmentation = "1.12"
|
||||||
|
|
|
||||||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2026 CRTkafa
|
Copyright (c) 2026 CRTkafa and Emrah
|
||||||
|
|
||||||
Portions of the script-alignment, cue-handling and voice-activity logic are
|
Portions of the script-alignment, cue-handling and voice-activity logic are
|
||||||
reimplementations of algorithms from Textream (https://github.com/f/textream),
|
reimplementations of algorithms from Textream (https://github.com/f/textream),
|
||||||
|
|
|
||||||
42
README.md
42
README.md
|
|
@ -14,13 +14,20 @@
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
The Windows port of <a href="https://github.com/f/textream"><strong>Textream</strong></a>
|
The Windows port of <a href="https://github.com/f/textream"><strong>Textream</strong></a>
|
||||||
by <a href="https://fka.dev">Fatih Kadir Akın</a>
|
by <a href="https://fka.dev">Fatih Kadir Akın</a>,
|
||||||
|
made by <a href="https://x.com/CRTkafa">CRTkafa</a> and <a href="https://x.com/vebaban_">Emrah</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
> 🇹🇷 **Türkçe:** Textream for Windows, [Fatih Kadir Akın](https://github.com/f)'ın
|
||||||
|
> macOS uygulaması [Textream](https://github.com/f/textream)'in Windows sürümüdür.
|
||||||
|
> Windows portunu [CRTkafa](https://x.com/CRTkafa), Türkçe konuşma tanımayı
|
||||||
|
> [Emrah](https://x.com/vebaban_) yaptı; proje artık ikisinin. Sesli takip
|
||||||
|
> (Word Tracking) modunda Türkçe metinler kelime kelime izlenir.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
> **v1.0.** All three guidance modes work end to end. Speech recognition
|
> **v1.3.** All three guidance modes work end to end. Speech recognition
|
||||||
> covers several languages but not Turkish yet — see
|
> covers several languages, Turkish included — see
|
||||||
> [Languages](#languages).
|
> [Languages](#languages).
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
|
@ -171,13 +178,15 @@ exactly when somebody has published a streaming model for it:
|
||||||
| English (small) — fastest, the default | 42 MB |
|
| English (small) — fastest, the default | 42 MB |
|
||||||
| English, German, French | 71 MB each |
|
| English, German, French | 71 MB each |
|
||||||
| Spanish | 156 MB |
|
| Spanish | 156 MB |
|
||||||
|
| Turkish | 73 MB |
|
||||||
| Chinese (Mandarin) | 77 MB |
|
| Chinese (Mandarin) | 77 MB |
|
||||||
| Arabic, Indonesian, Japanese, Russian, Thai, Vietnamese (one model) | 339 MB |
|
| Arabic, Indonesian, Japanese, Russian, Thai, Vietnamese (one model) | 339 MB |
|
||||||
|
|
||||||
**Turkish is not available yet.** A model exists — Kroko publishes a Turkish
|
Turkish uses [seda-v0.1](https://huggingface.co/atasoglu/seda-v0.1), a
|
||||||
community streaming model — but only in their own packaging, and nobody has
|
streaming Zipformer2 transducer trained on Common Voice and the ISSAI Turkish
|
||||||
converted it to the ONNX layout sherpa-onnx loads. That conversion is the whole
|
Speech Corpus (Apache-2.0). Its transcripts are lowercase, so the matcher folds
|
||||||
job; the app already handles everything after it.
|
`I`, `İ`, `i` and `ı` together — Unicode's default lowercase gets Turkish wrong,
|
||||||
|
and a capitalised script line would otherwise never match what was said.
|
||||||
|
|
||||||
Adding a language is a few lines in [`model.rs`](src-tauri/src/model.rs) and a
|
Adding a language is a few lines in [`model.rs`](src-tauri/src/model.rs) and a
|
||||||
published model to point at.
|
published model to point at.
|
||||||
|
|
@ -251,6 +260,12 @@ name listed in the file `WAYBETTER_FORBIDDEN_TERMS` points at, is still in it.
|
||||||
Reviewed false positives live in `privacy-allowlist.txt`. It needs CMake and
|
Reviewed false positives live in `privacy-allowlist.txt`. It needs CMake and
|
||||||
7-Zip, and only an installer that passed is published.
|
7-Zip, and only an installer that passed is published.
|
||||||
|
|
||||||
|
`WAYBETTER_RELEASE_CHECK` names the scanner command when it is not the CLI's
|
||||||
|
own `privacy-scan`. Without a Windows machine, the `release` workflow in
|
||||||
|
[`.forgejo/workflows/release.yml`](.forgejo/workflows/release.yml) builds the
|
||||||
|
same path-free installer on a Windows runner; it is scanned before it is
|
||||||
|
attached to a release.
|
||||||
|
|
||||||
Run the test suite:
|
Run the test suite:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
@ -266,7 +281,7 @@ cargo test --workspace
|
||||||
- [x] Classic and Voice-Activated modes end to end
|
- [x] Classic and Voice-Activated modes end to end
|
||||||
- [x] On-device streaming speech recognition — Word Tracking works
|
- [x] On-device streaming speech recognition — Word Tracking works
|
||||||
- [x] A model registry covering several languages
|
- [x] A model registry covering several languages
|
||||||
- [ ] Turkish, once a streaming model is converted for it
|
- [x] Turkish
|
||||||
- [x] Settings that persist across launches
|
- [x] Settings that persist across launches
|
||||||
- [x] Font, size, colour and opacity
|
- [x] Font, size, colour and opacity
|
||||||
- [x] Pause, hold, and mute from the transport dock
|
- [x] Pause, hold, and mute from the transport dock
|
||||||
|
|
@ -300,11 +315,18 @@ icon with his blessing. The cue syntax, the three guidance modes, and the
|
||||||
approach to word tracking are all his design.
|
approach to word tracking are all his design.
|
||||||
|
|
||||||
- Original macOS app: [github.com/f/textream](https://github.com/f/textream)
|
- Original macOS app: [github.com/f/textream](https://github.com/f/textream)
|
||||||
- Windows port: [CRT](https://git.crt.fyi/CRT)
|
- Textream for Windows: [CRTkafa](https://x.com/CRTkafa) and
|
||||||
|
[Emrah](https://x.com/vebaban_), at
|
||||||
|
[git.crt.fyi/CRT/textream-windows](https://git.crt.fyi/CRT/textream-windows)
|
||||||
|
- Windows port: [CRTkafa](https://x.com/CRTkafa)
|
||||||
|
- Turkish speech recognition: [Emrah](https://x.com/vebaban_) — first
|
||||||
|
published in his repository,
|
||||||
|
[github.com/veysiemrah/textream-windows](https://github.com/veysiemrah/textream-windows)
|
||||||
|
|
||||||
Speech recognition uses [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx) by
|
Speech recognition uses [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx) by
|
||||||
the k2-fsa team, with streaming models published by
|
the k2-fsa team, with streaming models published by
|
||||||
[csukuangfj](https://huggingface.co/csukuangfj).
|
[csukuangfj](https://huggingface.co/csukuangfj) and, for Turkish,
|
||||||
|
[atasoglu](https://huggingface.co/atasoglu).
|
||||||
|
|
||||||
The dyslexia-friendly typeface is
|
The dyslexia-friendly typeface is
|
||||||
[OpenDyslexic](https://opendyslexic.org) by Abbie Gonzalez, bundled under the
|
[OpenDyslexic](https://opendyslexic.org) by Abbie Gonzalez, bundled under the
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ use crate::alignment::{
|
||||||
DEFAULT_AGREEMENT_TOLERANCE,
|
DEFAULT_AGREEMENT_TOLERANCE,
|
||||||
};
|
};
|
||||||
use crate::script::PromptScript;
|
use crate::script::PromptScript;
|
||||||
use crate::text::{graphemes, is_readable, split_into_words};
|
use crate::text::{fold_case, graphemes, is_readable, split_into_words};
|
||||||
|
|
||||||
/// How far the matcher may look ahead on either side when it hits a mismatch.
|
/// How far the matcher may look ahead on either side when it hits a mismatch.
|
||||||
const MAX_SKIP: usize = 5;
|
const MAX_SKIP: usize = 5;
|
||||||
|
|
@ -54,15 +54,10 @@ impl PromptMatcher {
|
||||||
source.annotation_ranges(),
|
source.annotation_ranges(),
|
||||||
offset.min(source.character_count()),
|
offset.min(source.character_count()),
|
||||||
);
|
);
|
||||||
// Lowercasing per grapheme rather than over the whole string keeps a
|
// Folding per grapheme rather than over the whole string keeps a 1:1
|
||||||
// 1:1 index mapping. A whole-string lowercase can change the grapheme
|
// index mapping, so no case change can shift the offsets the matcher
|
||||||
// count (Turkish `İ` expands to two scalars) and silently shift every
|
// returns.
|
||||||
// offset the matcher returns.
|
let lowered = source.graphemes().iter().map(|g| fold_case(g)).collect();
|
||||||
let lowered = source
|
|
||||||
.graphemes()
|
|
||||||
.iter()
|
|
||||||
.map(|g| g.to_lowercase())
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
source,
|
source,
|
||||||
|
|
@ -174,7 +169,7 @@ impl PromptMatcher {
|
||||||
/// transcript reaches.
|
/// transcript reaches.
|
||||||
fn character_level_match(&self, spoken: &str) -> usize {
|
fn character_level_match(&self, spoken: &str) -> usize {
|
||||||
let source = &self.lowered[self.match_start_offset..];
|
let source = &self.lowered[self.match_start_offset..];
|
||||||
let spoken: Vec<String> = graphemes(&spoken.to_lowercase())
|
let spoken: Vec<String> = graphemes(&fold_case(spoken))
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|g| is_readable(g) || g.chars().all(char::is_whitespace))
|
.filter(|g| is_readable(g) || g.chars().all(char::is_whitespace))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
@ -257,7 +252,7 @@ impl PromptMatcher {
|
||||||
.source
|
.source
|
||||||
.slice(self.match_start_offset..self.source.character_count());
|
.slice(self.match_start_offset..self.source.character_count());
|
||||||
let source_words: Vec<&str> = remaining.split(' ').filter(|w| !w.is_empty()).collect();
|
let source_words: Vec<&str> = remaining.split(' ').filter(|w| !w.is_empty()).collect();
|
||||||
let spoken_words = split_into_words(&spoken.to_lowercase());
|
let spoken_words = split_into_words(&fold_case(spoken));
|
||||||
|
|
||||||
let mut source_index = 0usize;
|
let mut source_index = 0usize;
|
||||||
let mut spoken_index = 0usize;
|
let mut spoken_index = 0usize;
|
||||||
|
|
@ -265,9 +260,9 @@ impl PromptMatcher {
|
||||||
let mut inside_annotation = false;
|
let mut inside_annotation = false;
|
||||||
|
|
||||||
let alnum = |word: &str| -> String {
|
let alnum = |word: &str| -> String {
|
||||||
word.chars()
|
fold_case(word)
|
||||||
|
.chars()
|
||||||
.filter(|c| c.is_alphanumeric())
|
.filter(|c| c.is_alphanumeric())
|
||||||
.flat_map(char::to_lowercase)
|
|
||||||
.collect()
|
.collect()
|
||||||
};
|
};
|
||||||
let width = |word: &str| graphemes(word).len();
|
let width = |word: &str| graphemes(word).len();
|
||||||
|
|
@ -594,6 +589,22 @@ mod tests {
|
||||||
assert!(m.recognized_character_count() > 0);
|
assert!(m.recognized_character_count() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn turkish_capitals_match_a_lowercase_transcript() {
|
||||||
|
// The Turkish model writes lowercase spoken form, so `I` must meet
|
||||||
|
// `ı` and `İ` must meet `i`.
|
||||||
|
let mut m = matcher("IŞIK SÖNDÜ İSTANBUL'DA");
|
||||||
|
m.match_transcript("ışık söndü istanbulda");
|
||||||
|
assert_eq!(m.recognized_character_count(), m.source().character_count());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn a_dotted_capital_does_not_shift_offsets() {
|
||||||
|
let mut m = matcher("İzmir güzel bir şehir");
|
||||||
|
m.match_transcript("izmir güzel");
|
||||||
|
assert_eq!(m.source().slice(0..m.recognized_character_count()).trim_end(), "İzmir güzel");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn word_progress_follows_the_highlight() {
|
fn word_progress_follows_the_highlight() {
|
||||||
let mut m = matcher("alpha beta gamma");
|
let mut m = matcher("alpha beta gamma");
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,27 @@ pub fn infer_direction(text: &str) -> TextDirection {
|
||||||
TextDirection::LeftToRight
|
TextDirection::LeftToRight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Lowercases `text` for comparison, folding the four Turkish i's together.
|
||||||
|
///
|
||||||
|
/// Unicode's default lowercase is wrong for Turkish in both directions: `I`
|
||||||
|
/// becomes `i` where a Turkish recogniser writes `ı`, and `İ` becomes `i` plus
|
||||||
|
/// a combining dot that no transcript ever contains. So a script line such as
|
||||||
|
/// "IŞIK" or "İSTANBUL" would never match what was said. Folding `I`, `İ`, `i`
|
||||||
|
/// and `ı` to one `i` fixes Turkish without needing to know the language, and
|
||||||
|
/// costs the matcher nothing elsewhere — it is fuzzy about single letters
|
||||||
|
/// anyway, and no other language contrasts dotted with dotless i.
|
||||||
|
pub fn fold_case(text: &str) -> String {
|
||||||
|
let mut folded = String::with_capacity(text.len());
|
||||||
|
for c in text.chars().flat_map(char::to_lowercase) {
|
||||||
|
match c {
|
||||||
|
'ı' => folded.push('i'),
|
||||||
|
'\u{0307}' if folded.ends_with('i') => {}
|
||||||
|
other => folded.push(other),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
folded
|
||||||
|
}
|
||||||
|
|
||||||
/// Splits `text` into owned grapheme clusters — the unit every offset in this
|
/// Splits `text` into owned grapheme clusters — the unit every offset in this
|
||||||
/// crate is measured in.
|
/// crate is measured in.
|
||||||
pub fn graphemes(text: &str) -> Vec<String> {
|
pub fn graphemes(text: &str) -> Vec<String> {
|
||||||
|
|
@ -188,6 +209,27 @@ mod tests {
|
||||||
assert_eq!(graphemes("a👍🏽b").len(), 3);
|
assert_eq!(graphemes("a👍🏽b").len(), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fold_case_unifies_the_turkish_i() {
|
||||||
|
assert_eq!(fold_case("IŞIK"), fold_case("ışık"));
|
||||||
|
assert_eq!(fold_case("İSTANBUL"), "istanbul");
|
||||||
|
assert_eq!(fold_case("I\u{0307}stanbul"), "istanbul");
|
||||||
|
assert_eq!(fold_case("Iğdır"), "iğdir");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fold_case_keeps_one_grapheme_per_grapheme() {
|
||||||
|
for g in ["İ", "I", "ı", "Ş", "Ğ", "Ö", "Ü", "Ç"] {
|
||||||
|
assert_eq!(graphemes(&fold_case(g)).len(), 1, "{g}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fold_case_leaves_other_combining_dots_alone() {
|
||||||
|
// U+0307 after a letter other than i is real content and must survive.
|
||||||
|
assert_eq!(fold_case("a\u{0307}"), "a\u{0307}");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn readability_ignores_punctuation_and_emoji() {
|
fn readability_ignores_punctuation_and_emoji() {
|
||||||
assert!(is_readable("word"));
|
assert!(is_readable("word"));
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "textream-windows",
|
"name": "textream-windows",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.2.0",
|
"version": "1.3.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ const root = dirname(dirname(fileURLToPath(import.meta.url)));
|
||||||
const { version } = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
|
const { version } = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
|
||||||
const installer = join(root, 'target', 'release', 'bundle', 'nsis', `Textream_${version}_x64-setup.exe`);
|
const installer = join(root, 'target', 'release', 'bundle', 'nsis', `Textream_${version}_x64-setup.exe`);
|
||||||
const waybetter = process.env.WAYBETTER_CLI ? ['node', process.env.WAYBETTER_CLI] : ['waybetter'];
|
const waybetter = process.env.WAYBETTER_CLI ? ['node', process.env.WAYBETTER_CLI] : ['waybetter'];
|
||||||
|
// The scanner is no longer part of the public CLI: WAYBETTER_RELEASE_CHECK names the command that runs it.
|
||||||
|
const scanner = process.env.WAYBETTER_RELEASE_CHECK ? process.env.WAYBETTER_RELEASE_CHECK.split(' ') : [...waybetter, 'privacy-scan'];
|
||||||
|
|
||||||
function run(step, [command, ...args]) {
|
function run(step, [command, ...args]) {
|
||||||
console.log(`\n== ${step}`);
|
console.log(`\n== ${step}`);
|
||||||
|
|
@ -35,5 +37,5 @@ if (!existsSync(installer)) {
|
||||||
console.error(`release: the build left no ${installer}`);
|
console.error(`release: the build left no ${installer}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
run('scan the installer', [...waybetter, 'privacy-scan', installer, '--allow', join(root, 'privacy-allowlist.txt')]);
|
run('scan the installer', [...scanner, installer, '--allow', join(root, 'privacy-allowlist.txt')]);
|
||||||
console.log(`\nClean. Publishable: ${installer}`);
|
console.log(`\nClean. Publishable: ${installer}`);
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,25 @@ pub const MODELS: &[SpeechModel] = &[
|
||||||
},
|
},
|
||||||
download_bytes: 156_200_000,
|
download_bytes: 156_200_000,
|
||||||
},
|
},
|
||||||
|
SpeechModel {
|
||||||
|
id: "tr",
|
||||||
|
label: "Turkish",
|
||||||
|
language: "tr",
|
||||||
|
repo: "atasoglu/seda-v0.1",
|
||||||
|
files: ModelFiles {
|
||||||
|
encoder: "encoder.int8.onnx",
|
||||||
|
decoder: "decoder.onnx",
|
||||||
|
joiner: "joiner.int8.onnx",
|
||||||
|
tokens: "tokens.txt",
|
||||||
|
},
|
||||||
|
hashes: ModelHashes {
|
||||||
|
encoder: "2596861911cec5ca1de31adc12a7fc983d05395434f92239f4e007eeae3a5dcc",
|
||||||
|
decoder: "dc28b7ae3f5e67c0daa2d51886dae2ac8287a25333f46a363f3684b3cd1220c9",
|
||||||
|
joiner: "b4d1cff7c410d14c85c143885954be09a6a4a076cd35d22aeba58655665582bb",
|
||||||
|
tokens: "f6e134fa357558d0c4ab56fbe380323c30e3d50a13fe402a68328d5a13c2236b",
|
||||||
|
},
|
||||||
|
download_bytes: 72_800_000,
|
||||||
|
},
|
||||||
SpeechModel {
|
SpeechModel {
|
||||||
id: "zh",
|
id: "zh",
|
||||||
label: "Chinese (Mandarin)",
|
label: "Chinese (Mandarin)",
|
||||||
|
|
|
||||||
|
|
@ -297,8 +297,11 @@ mod tests {
|
||||||
/// zeroed — get a field wrong and this is where it shows up, rather than in
|
/// zeroed — get a field wrong and this is where it shows up, rather than in
|
||||||
/// front of a presenter mid-take.
|
/// front of a presenter mid-take.
|
||||||
///
|
///
|
||||||
|
/// `TEXTREAM_TEST_MODEL_ID` picks which registry entry the directory holds,
|
||||||
|
/// defaulting to the default model.
|
||||||
|
///
|
||||||
/// ```text
|
/// ```text
|
||||||
/// TEXTREAM_TEST_MODEL_DIR=<dir> cargo test -p textream -- --ignored
|
/// TEXTREAM_TEST_MODEL_DIR=<dir> TEXTREAM_TEST_MODEL_ID=tr cargo test -p textream -- --ignored
|
||||||
/// ```
|
/// ```
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore = "needs a downloaded speech model"]
|
#[ignore = "needs a downloaded speech model"]
|
||||||
|
|
@ -306,13 +309,11 @@ mod tests {
|
||||||
let Ok(directory) = std::env::var("TEXTREAM_TEST_MODEL_DIR") else {
|
let Ok(directory) = std::env::var("TEXTREAM_TEST_MODEL_DIR") else {
|
||||||
panic!("set TEXTREAM_TEST_MODEL_DIR to a directory holding a model");
|
panic!("set TEXTREAM_TEST_MODEL_DIR to a directory holding a model");
|
||||||
};
|
};
|
||||||
let files = ModelFiles {
|
let model = match std::env::var("TEXTREAM_TEST_MODEL_ID") {
|
||||||
encoder: "encoder-epoch-99-avg-1.int8.onnx",
|
Ok(id) => crate::model::find(&id).unwrap_or_else(|| panic!("no model {id}")),
|
||||||
decoder: "decoder-epoch-99-avg-1.int8.onnx",
|
Err(_) => crate::model::default_model(),
|
||||||
joiner: "joiner-epoch-99-avg-1.int8.onnx",
|
|
||||||
tokens: "tokens.txt",
|
|
||||||
};
|
};
|
||||||
let paths = ModelPaths::in_directory(Path::new(&directory), &files);
|
let paths = ModelPaths::in_directory(Path::new(&directory), &model.files);
|
||||||
assert!(paths.all_present(), "model files missing in {directory}");
|
assert!(paths.all_present(), "model files missing in {directory}");
|
||||||
|
|
||||||
let mut recognizer = Recognizer::new(&paths).expect("recogniser should load");
|
let mut recognizer = Recognizer::new(&paths).expect("recogniser should load");
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Textream",
|
"productName": "Textream",
|
||||||
"version": "1.2.0",
|
"version": "1.3.0",
|
||||||
"identifier": "dev.crtkafa.textream",
|
"identifier": "dev.crtkafa.textream",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "bun run dev",
|
"beforeDevCommand": "bun run dev",
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
"runtime/sherpa-onnx-c-api.dll": "sherpa-onnx-c-api.dll",
|
"runtime/sherpa-onnx-c-api.dll": "sherpa-onnx-c-api.dll",
|
||||||
"runtime/sherpa-onnx-cxx-api.dll": "sherpa-onnx-cxx-api.dll"
|
"runtime/sherpa-onnx-cxx-api.dll": "sherpa-onnx-cxx-api.dll"
|
||||||
},
|
},
|
||||||
"copyright": "Copyright (c) 2026 CRTkafa",
|
"copyright": "Copyright (c) 2026 CRTkafa and Emrah",
|
||||||
"shortDescription": "Teleprompter for Windows",
|
"shortDescription": "Teleprompter for Windows",
|
||||||
"longDescription": "A free Windows teleprompter with real-time word tracking, classic auto-scroll and voice-activated scrolling. Everything runs on-device.",
|
"longDescription": "A free Windows teleprompter with real-time word tracking, classic auto-scroll and voice-activated scrolling. Everything runs on-device.",
|
||||||
"windows": {
|
"windows": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue