Skip to content

Releases

v0.0.7

Choose a tag to compare

@github-actions github-actions released this 28 Oct 06:45
v0.0.7
191a97f

utter 0.0.7 adds a merge margin: a setting that keeps, among the readings, those the search overwrites while they are close to the path that wins. It is off by default, and off, every result is 0.0.6's byte for byte.

Added

The merge margin, recorded as TD-18. Where two paths with different words meet in one graph state, the decoder keeps the cheaper and the other's history is gone, even when it was a fraction of a nat behind. Recognizer::set_merge_margin, utter_recognizer_set_merge_margin in C, sets a margin in nats. A merge whose loser is within it of the winner then keeps the loser's history on the winner's path, at its cost over the winner, which never changes after the merge.

The partial's readings and the final's alternatives list each kept reading at its cheapest copy, with confidence, relation, lead_delta and word entries like any other. Rank 0, the endpoint rules, the host's bound and its veto, and every key outside the readings read the survivors only. Kept readings are read out only as far as the list asked for could show them, so the readout's cost does not grow with the utterance.

Under a grammar of "go seven" and "no seven", the seven clip in tests/data reads both ways 0.19 nats apart. Without a margin the partials offer "no seven" 6.6 nats behind for six advances and then not at all; with a margin of 3 it is offered 0.19 behind at every advance.

Over the 11,005 Speech Commands test clips, ten readings and ten alternatives, a margin of 3 gave 509 of 281,912 results a reading within 3 nats of rank 0 that the survivors did not list, 171 of them finals, and rank 0 moved in none. The margin offers what was close, not what was right: the clip's word is among a final's first n alternatives as often at n = 1, and a few clips less often at n = 2, 5 and 10, where a kept reading closer than the right word takes its place.

On the compute gate's streams (400 clips in 40 streams, 571 s of audio in 40 ms blocks, the fastest of five repetitions per block on one core), against 0.0.6:

p99 block slowest block real-time factor
0.0.6 2.506 ms 4.34 ms 0.01041
0.0.7, no margin 2.530 ms 4.58 ms 0.01045
0.0.7, margin 1 2.568 ms 4.43 ms 0.01060
0.0.7, margin 3 2.619 ms 4.67 ms 0.01073

A margin of 1 costs 7.5 to 10.9 µs a block and a margin of 3 about 13. Without a margin a block costs 1.5 to 2.6 µs more, inside the gate's own spread between runs, and the search alone takes 24.40 µs a frame against 0.0.6's 24.57: each search pass is compiled with and without the margin.

stream gains --merge-margin, --max-alternatives and --census-nats, and its census counts a reading overwritten within the margin of the frame's best token at the merge.

The Speech Commands page's compute section times the result a host reads after every block, plainly and under each setting a host can turn on (partial words, readings, final alternatives, the endpoint bound and its veto, the floor margin, the unknown word, merge margins, and every option together), with each setting's cost over plain.

v0.0.6

Choose a tag to compare

@github-actions github-actions released this 30 Sep 09:12
v0.0.6
acbbefd

utter 0.0.6 adds TitaNet-small as a speaker model. It embeds each word's span on a thread of the recognizer's own, and the recognizer's thread costs about what it costs with no speaker model. Every partial and final now rates how well the acoustic model hears the audio and describes the sound outside words. It also adds normalized float input, and a stream's heap stays flat however long the stream runs. Without a speaker model and with the new rating keys taken out, integer input gives byte-for-byte the output of 0.0.5.

Added

TitaNet-small speaker evidence, recorded as TD-15 and TD-16. scripts/titanet_convert.py converts the published TitaNet-small ONNX into a model directory. SpeakerModel::open and utter_spk_model_new open it as they open an x-vector directory, and set_spk_model and utter_recognizer_set_spk_model set it on a recognizer. A word's entry then carries spk, spk_frames, spk_start and spk_end, as with the x-vector. Partials and finals carry no top-level evidence. The model needs audio at 16 kHz or faster.

By default the recognizer embeds on a thread of its own, spawned when the model is set. At each decoder advance it queues the best path's words, the open word over its span so far. A span's evidence is published on the results read after the first accept that brings 40 ms more audio. If the thread has not finished by then, that accept waits for it. So the result that first carries a word's evidence is the same on every machine. Fed faster than real time, as a batch host feeds, the accepts wait more often.

set_spk_threads(false), utter_recognizer_set_spk_threads in C, runs no thread. The recognizer embeds a word once its span has closed, in slices budgeted by work, never by time, on accept calls that do not advance the decoder, so evidence never moves a result to a later block. A host whose blocks are a decoder chunk (about 0.5 s) or longer advances the decoder on every accept and gets no evidence this way. A span's evidence has the same bytes in both modes; only the result that first carries it differs.

On the speaker-cost streams (400 clips, 40 streams, 571 s of audio in 40 ms blocks) fed in real time, five repetitions, the recognizer on one hardware thread of a core and the TitaNet thread on the other:

99th percentile block slowest block real-time factor
0.0.6 TitaNet-small, the recognizer's thread 3.027 ms 5.05 ms 0.01306
0.0.5, no speaker model 3.011 ms 5.37 ms 0.01296
0.0.6, no speaker model 3.017 ms 4.90 ms 0.01307

No accept waited. The TitaNet thread's own real-time factor is 0.0054.

Single-threaded, fed as fast as it decodes on one core, against 0.0.5 with the x-vector:

0.0.5 x-vector 0.0.6 TitaNet-small
99th percentile block 2.911 ms 2.604 ms
slowest block 5.95 ms 4.45 ms
real-time factor 0.01713 0.01335

Single-threaded TitaNet-small comes out ahead in every configuration measured: three readings, three readings with ten alternatives, and floor margin 8. With the speaker keys taken out, the transcripts match those with no speaker model exactly.

How long after a word ends its evidence arrives, and how many final words carry it:

mode median 90th percentile 99th percentile final words with evidence
multi-threaded 200 ms 380 ms 500 ms 90.7%
single-threaded 420 ms 530 ms 610 ms 89.7%

On the speaker page (205 speakers, 1980 probe words), one word through TitaNet-small, multi-threaded, clears a gate at 1% false accept 81.2% of the time, against 41.6% for the x-vector in the same recognizer:

word length TitaNet-small x-vector
under 400 ms 62.5% 30.5%
400 to 600 ms 84.5% 42.3%
600 ms and over 89.4% 49.9%

Among two enrolled speakers, one word names its speaker 93.8% of the time against the x-vector's 96.2%, because 5.8% of words carry no TitaNet evidence against 2.0%, and a word without evidence names no one. Single-threaded, the figures are 80.7% and 93.3%.

The x-vector stays as the speaker model for audio below 16 kHz, which TitaNet-small does not take.

Any span can be embedded directly with SpeakerModel's embed, utter_spk_model_embed and utter_spk_model_dim, with either model layout.

The acoustic model's certainty and the sound outside words, recorded as TD-17. Every partial and final carries these keys, with no setting to turn them on:

  • certainty_words and certainty_outside: 1 minus the normalised entropy of the acoustic network's output, 0 to 1, averaged over the frames decoded since the previous result. The path splits the frames into those in words and those outside them. words_frames and outside_frames count them. The rating depends on the network and the audio alone, not the grammar or the path.
  • band_db, band_sd_db, rise_start_sample, rise_ms and rise_db: the sound over the frames in no named word. That is each of the front end's mel bands in dB over the band's own floor, each band's standard deviation, and the loudest rise with its start, length and level over the broadband floor. A steady noise, a low hum and a click come out apart; the runtime names none of them.

Every word entry carries certainty over its own span, and the [sil] and [speech] entries of partial_result carry the sound over theirs. On the stock small models the certainty sits well under 0.1, and only differences within one model mean anything. Results grow about fourfold on the benchmark streams. With the keys taken out, every result is 0.0.5's byte for byte. On TD-17's streams they cost up to 0.9% in real-time factor against 0.0.5 and 0.015 ms at the 99th percentile block, and the slowest block is faster in every configuration. On the Speech Commands page's steady state, three runs a side, the median block is 3.2% slower and the 99th percentile 2.5% slower, 0.068 ms; the real-time factor moves within the spread between runs. The sound-rating benchmark page measures what they tell apart on public audio.

Normalized float input, recorded as TD-13. Recognizer::accept_f32 takes samples at full scale -1.0 and 1.0. A block with a sample that is not finite or not within that range is refused whole and leaves the recognizer as it was. A 16-bit sample s given as s / 32768.0 gives exactly what accept gives for s, and the two calls may be interleaved. The history stays at two bytes a sample until the first sample that is not a 16-bit value.

A small-models gate page compares German, French, Spanish and Russian small models against the stock wheel on Common Voice's single words. Every model passes every bar.

Fixed

A stream's heap no longer grows with its length. In 0.0.5 it grew by about 400 KiB a second, reaching 246 MiB at 20 minutes. Now it stays near 17.9 MiB, or 23.2 MiB with the x-vector. A speaker model set mid-stream starts at the current utterance, with its mean normalisation starting afresh there.

The benchmark preflight opens each engine in its own process. The published pages had charged the engine opened second about 20 ms that was not its own.

The Speech Commands harness sends grammars as unescaped JSON, so the stock wheel keeps non-ASCII words.

v0.0.5

Choose a tag to compare

@github-actions github-actions released this 24 Sep 18:41
v0.0.5
08de39f

utter 0.0.5 puts speaker evidence on every word, so a host can decide who said a command word by word, before the utterance ends. Without a speaker model the output is identical to 0.0.4.

Added

Speaker evidence, recorded as TD-14. A host opens a speaker model directory in the layout vosk's SpkModel reads, vosk-model-spk-0.4 among them, and sets it on a recognizer: set_spk_model in Rust, SetSpkModel in Python, utter_spk_model_new and utter_recognizer_set_spk_model in C. Every word entry that is a word or [speech], in the partial, its readings, the final and the final's alternatives, then carries spk, the vector over its own span; spk_frames, the 10 ms frames pooled; and spk_start and spk_end, the span in samples on the clock of start_sample. Every partial and final carries the same keys over its speech. No key names a speaker: profiles, scores and thresholds are the host's.

The network computes a frame's row at most once, and only for frames a word's evidence pools or is likely to, over features normalised by a mean that looks back only. A word's evidence reaches a partial a median 40 ms after the word ends, and the same audio in the same blocks gives the same vectors. The evidence moves no word, partial or final to a later block. On the speaker page's streams, clips back to back, the model takes the real-time factor from 0.0117 to 0.0197, the median block from 0.060 to 0.078 ms and the 99th percentile from 2.86 to 3.26 ms. The stock wheel with its speaker model costs about as much in total but spends it on the block that closes an utterance, a median 15.5 ms there. Stage by stage against Kaldi's own binaries, the features agree within 4.6e-3 and the vectors within 1.6e-3. The vectors differ from the stock wheel's, which pools the whole utterance after a centred normalisation, so profiles and thresholds fitted on the wheel's vectors do not carry over; enrolment recordings serve as they are.

A new benchmark page, speaker evidence, measures it on 206 Speech Commands speakers. One word names its speaker among two enrolled speakers 95.4% of the time, against 48.4% for the stock wheel, which gives no vector for a word under half a second. A gate at 1% false accept passes 40.1% of words; TitaNet-small, measured beside it, passes 85.7%, and the roadmap now carries a stronger model.

v0.0.4

Choose a tag to compare

@github-actions github-actions released this 14 Sep 05:36
v0.0.4
81578e0

utter 0.0.4 fixes the floor margin of 0.0.3 so that it does not cut a quiet word after a pause. Nothing else changes; with the margin unset the output is identical to 0.0.3.

Fixed

The floor margin on the host's endpoint bound now reads no span shorter than the bound itself. In 0.0.3 a trailing [speech] entry or a rival's extending word was judged against the floor at any length, and the first frames of a quiet word after a pause sit near the floor on any microphone, so the margin could waive the veto and the bound fire into the word. A span at least the bound's length is seconds long on a cold room and a few frames at an onset, so the wordless closes stay and the onsets do not: on the public background recordings at a -50 dBFS floor the margin closes a wordless stretch at a median 1.2 s instead of 0.72, still with one forced word in 6.7 minutes where the stock rules leave 11. On the first consumer's 33 recordings, at the finals, 65 forced and floor-level phantoms leave, 9 spoken words the 20 s cap had eaten come back, and 2 short words that begin just after a wordless close are lost, the measured price of a boundary in hiss. TD-12 is amended with the rule, the measurement and the price, and a new benchmark page, quiet onsets, holds every word's first frames near the floor to keep the case in view.

v0.0.3

Choose a tag to compare

@github-actions github-actions released this 14 Sep 03:52
v0.0.3
10185dd

utter 0.0.3 lets the host's endpoint bound close a quiet room without a forced word, tells a host which runtime it loaded, and ships its attestation bundle with the release. The decoding output is unchanged unless the new margin is set.

Added

A floor margin on the host's endpoint bound: set_endpoint_floor_margin in Rust, SetEndpointFloorMargin in Python, utter_recognizer_set_endpoint_floor_margin in C. On a quiet room the model reads the hiss as a word's first phone, no silence rule sees trailing silence, and the 20 s cap then forces the cheapest grammar word onto the stretch. With a margin in dB over the reported floor, a trailing [speech] entry within it counts as trailing silence, a rival word within it cannot veto, and the final the bound reaches that way is the path as it stood: an empty word list, the text [sil] or [speech], and the new endpoint value floor. Off by default and byte-identical when unset. Recorded as TD-12.

utter_version and utter_revision in the C ABI, static strings naming the crate version and the git commit the library was built from.

Fixed

REVISION reports the commit in a crate built from crates.io; 0.0.1 and 0.0.2 report "unknown" from the registry. The build script reads the commit cargo package records when there is no checkout.

Digital silence no longer reads as -999 dBFS. A word entry's energy_dbfs is null when there is no signal under the word, and floor_dbfs is absent while the quietest windows of the last ten seconds are digital silence, so a host gate relative to the floor is not handed a number every word sits above.

Distribution

The release attaches the Sigstore bundle of its build-provenance attestation, utter-v0.0.3.sigstore.json, so an archive verifies offline:

gh attestation verify utter-linux-x86_64.tar.gz --bundle utter-v0.0.3.sigstore.json --owner pyscape

v0.0.2

Choose a tag to compare

@github-actions github-actions released this 14 Sep 01:42
v0.0.2
da97dd2

utter 0.0.2 hardens the readers against malformed model files and audio, and ships prebuilt binaries for six platforms. The decoding API and its output are unchanged from 0.0.1.

Security

The model-file and audio readers no longer panic or allocate from an unchecked length on malformed input. A length or count is checked against the bytes behind it before it sizes an allocation, and an out-of-range id or state is rejected as an error. Six fuzz targets cover the Kaldi reader, the FST reader, the JSON grammar, the transition model, the i-vector extractor and the audio path, and run on every push and for longer weekly. The seven classes of crash the fuzzer first found are fixed, each with a regression test.

Changed

Narrowing numeric conversions are checked throughout. A negative or out-of-range dimension, word id or state read from a corrupt model file is now an error rather than a wrapped value.

No change to the decoding API or its output: the benchmark per-clip records are identical to 0.0.1.

Binaries

Release archives for Linux (x86_64 and aarch64), Windows (x86_64 and arm64) and macOS (one universal binary), each with the shared library, the stream tool, the C header and the licenses. Windows archives are zips; the Linux libraries link against glibc 2.28, so they load on RHEL 8, Ubuntu 20.04 and Debian 11 and newer. Every archive carries a build-provenance attestation:

gh attestation verify utter-linux-x86_64.tar.gz -R pyscape/utter

Install

cargo add utter        # Rust
pip install utterpy    # Python

License

MIT, with the vendored Vosk-Rust files kept under Apache-2.0.

utter 0.0.1

Choose a tag to compare

@pyscape pyscape released this 13 Sep 21:14
f158147

The first release of utter, a pure-Rust streaming speech recognizer for Vosk models, built for applications that act on partial results. Zero dependencies: no C toolchain, no Docker, no cloud. It opens a stock Vosk model directory as-is.

What it does

  • Streams 16 kHz audio in small blocks and after every block reports the words it believes so far, the rival readings it is still weighing, the span and energy of each word, and when the speaker stopped.
  • Decodes under a grammar, as the Vosk wheel's KaldiRecognizer does with a word list, with an optional unknown-word symbol at a cost you set.
  • Partials carry alternatives, word times, each reading's relation to the current best and the motion of its lead, and whether a word has begun on a wordless block.
  • Finals say what closed them, an endpoint or a flush, and how long each word held.
  • A host endpoint bound: a final once the trailing silence reaches a bound you choose, unless a reading that extends the partial by a further word is within a veto margin of it.

Surfaces

  • Rust: the utter crate. Model::open, Recognizer::new, accept, partial, result, final_result.
  • C: a shared library and include/utter.h, mirroring libvosk's vosk_api.h names. The Linux, Windows and macOS libraries are attached below with the header, licenses and notice.
  • Python: the utterpy package on PyPI, a drop-in for the vosk package's object surface, shipping type stubs.

All three return the same JSON strings. Every document and key is described in docs/reference/results.md; what changes for code written against the Vosk wheel is in docs/reference/vosk.md.

Measured

On the public Speech Commands benchmark it matches the stock Vosk wheel: 91.8% against 91.5% accuracy on 11,005 clips, finals agreeing on 99.2% of them, the same 40 ms median first-appearance latency. Every gate and benchmark page is under docs/gates and docs/benchmarks, with the scripts that produce them.

One parity gap is open: segment-for-segment agreement with libvosk on the private test corpus sits just under the mark the gate asks for, on near ties in the acoustics.

Models

The English small model, vosk-model-small-en-us-0.15, is the reference. Other small models with the same layout are expected to work and have not been checked. Models with network components the runtime does not implement, such as the CNN-TDNN in vosk-model-en-us-0.22-lgraph, are refused when opened, naming the component.

Stability

The API keeps the Vosk wheel's shape. Expect breaking changes before 0.1.

License

MIT, with the Kaldi model reader, MFCC and nnet3 forward pass vendored from Vosk-Rust under Apache-2.0 with its notices kept.

One detail to handle in the workflow: the release job has generate_release_notes: true, which appends GitHub's auto-generated commit list under whatever body the release carries. If you want only the notes above, I'll switch that flag off and have the job read the body from a file in the repository, so the notes are reviewed in the PR like everything else. Say so and I'll add it.

What's Changed

  • Bump actions/checkout from 4 to 7 by @dependabot[bot] in #1
  • Bump actions/setup-python from 5 to 7 by @dependabot[bot] in #2
  • Bump github/codeql-action from 3 to 4 by @dependabot[bot] in #3
  • Bump actions/upload-artifact from 4 to 7 by @dependabot[bot] in #4
  • Bump actions/cache from 4 to 6 by @dependabot[bot] in #5
  • utter 0.0.1: the streaming runtime, its gates and benchmarks, and the release path by @pyscape in #6
  • The release builds the library for six platforms by @pyscape in #7
  • README: registry badge URLs that miss the stale cache by @pyscape in #8

New Contributors

Full Changelog: https://github.com/pyscape/utter/commits/v0.0.1