bitbaum Start a project
Package · MIT

speechkit

Measure how somebody spoke — pauses, rate, where they searched for a word, grammar a listener would notice — and say only what the evidence allows. Language-agnostic; no pronunciation score, on purpose.

LicenceMIT
Registry releasev1.0.1
Install
Sourcebitbaum/speechkit
Declared consumers1 repository

API and examples

Documentation from source commit 243aab245847 · 2026-11-08. Source documentation can include work beyond the registry release.

Read the package documentation

Measure how somebody spoke — and say only what the evidence allows.

A learner records themselves speaking a language they are learning. speechkit tells them, from that recording:

  • how it went — how long they spoke, how often and how long they paused, how long they went before stopping;
  • how fast — speech rate and articulation rate, and what the pair suggests (have the words but hunting for them, or neither);
  • where they searched for a word — "1.8 s before Buch": the word after a long pause is usually the one they were reaching for;
  • grammar a listener would notice — "den Buch → das Buch", from your own LanguageTool, never spelling, casing or punctuation, which the recogniser decided and the speaker did not.

It will not give a pronunciation score. That is not a gap waiting to be filled: a score against a native ideal is a judgement about a person, and no improvement in speech recognition makes it honest. A test in this repo fails if an export ever starts to look like one.

Extracted from Heidi, where it runs the speaking practice for Zurich German learners.

Install

pnpm add @bitbaum/speechkit

On npm since 2026-09-25. dist/ is also committed, so github:bitbaum/speechkit#v1.0.0 works without a build step if you need a git pin.

The rule everything else follows

A transcript is evidence about a speaker's words only when the recogniser returns the variety that was spoken.

Swiss German recognition translates into Standard German — that is what every public corpus was built to do. A learner who says a flawless Zurich sentence gets back ist and nicht, none of which they said. Judging their grammar from that corrects the machine's German and bills it to the learner.

import { evidenceFrom, mayJudgeForm } from "@bitbaum/speechkit";

evidenceFrom({ available: true, returnsSpokenVariety: false, wer: 25.6 }); // "meaning-only"
evidenceFrom({ available: true, returnsSpokenVariety: true, wer: 6.4 });   // "words"
mayJudgeForm({ available: true, returnsSpokenVariety: true, wer: 22 });     // false — too many of its words are its own

So the same product is honest in both directions: on a dialect nothing transcribes faithfully, measure the signal and judge no forms; on a variety that is transcribed faithfully, measure the words too.

Layers

LayerNeedsExports
signalraw samples`measureDelivery`, `usable`, `MIN_PAUSE_MS` / `SEARCH_PAUSE_MS` / `STUCK_PAUSE_MS`
evidencewhat the recogniser does`evidenceFrom`, `mayJudgeForm`, `isFaithfulRendering`
wordsa faithful transcript`measureSpoken`, `hesitations`, `markerVerdict`, `measureFluency`, `countFilledPauses`
grammara faithful transcript + LanguageTool`checkGrammar`, `fromLanguageTool`, `worthShowing`
practice designnothing`NATION_LADDER`, `trajectory`, `nextLimit` (4/3/2 task repetition)

Every fact about a language is passed in: vowels and whether adjacent vowels merge (SyllableRule), filler words, dialect marker words, the LanguageTool code. Nothing in the package names a language — Heidi runs it on Zurich German and Ukrainian from the same code, and Ukrainian found a real bug (it has no diphthongs, so merging adjacent vowels undercounted syllables by a third).

Where somebody searched for a word

import { measureDelivery, hesitations } from "@bitbaum/speechkit";

const delivery = measureDelivery(samples, sampleRate);      // on the device, from the audio
const found = hesitations(delivery.pauseSpans ?? [], words); // words: timings from your recogniser
// → [{ before: "Buch", index: 3, ms: 1800 }]

The pauses come from the signal, and the recogniser's timings only name them. Recognisers are poor clocks for silence: Whisper was observed stretching a one-syllable word across a 1.8 s pause and leaving no gap between words at all. The test for this uses the exact timings it returned.

Word timings: transcribe({ words: true }) in @bitbaum/ai-kit ≥ 1.16.

Grammar: run your own checker

docker run -d --name languagetool --restart unless-stopped \
  -p 127.0.0.1:8010:8010 -e Java_Xmx=1g --memory 1536m erikvl87/languagetool:6.8

checkGrammar(text, "de-CH") defaults to http://127.0.0.1:8010. Bind it to loopback: the server has no authentication, and the text is what somebody said out loud. Pointing url at the public API works and is a privacy decision to make — and disclose — on purpose. The package reads no environment.

null means not checked (the checker was down or slow); an empty findings means checked, nothing a listener would notice. Show them differently, or a page tells somebody their German was clean on the day the checker was off.

LanguageTool is partial and the page should say so. On German it catches agreement, case and verb forms (ich gehen, den Buch) and misses verb position after weil.

The § references in the source

Comments cite sections of Heidi's design principles, which is where the reasoning was argued:

  • §3 — a decision (a threshold we chose and can defend) is labelled as one, never dressed up as a finding;
  • §6 — a model is never the sole judge of language the learner cannot audit; findings are deterministic, with a rule id you can argue with;
  • §7 — the state of Swiss German speech technology, measured rather than taken from vendors;
  • §8 — no false precision: no norms, no grades, no scores. Every number is reported as itself and compared only with the same learner's earlier takes.

Releasing

1.0.0 was published by hand on 2026-09-25 — npm will not let a Trusted Publisher be configured for a package that does not exist yet. Releases are meant to be tag-driven and tokenless (npm Trusted Publishing), the same as ai-kit, once one more step is done by whoever holds the account's passkey:

npm login --auth-type=web     # a real 2FA session; approve with the passkey
npm trust github @bitbaum/speechkit --file publish.yml --repo bitbaum/speechkit --yes
gh variable set NPM_PUBLISHING -b on --repo bitbaum/speechkit

After that, git tag vX.Y.Z && git push origin vX.Y.Z on a merged version bump publishes with provenance. Until then a tag's Publish run is green, publishes nothing, and says why.

Develop

pnpm install
pnpm run verify   # format, lint, types, build, unit tests on the source, tests on dist/

CI fails if the committed dist/ differs from what the source builds to.

License

MIT

Changelog and releases

Read the repository changelog

This retrospective record was added on 2026-10-27 from the immutable sources linked below. Git commit dates are source dates, not inferred npm publication dates. A GitHub release does not itself establish npm publication. Application adoption and deployment evidence are tracked separately.

1.0.0

No authored release notes were found for this tag when this record was made. The links identify the verified source; missing feature history is not invented.

  1. v1.0.1
    Release notes

    What's Changed

    * docs: link Heidi's source rather than its site by @catomean in https://github.com/bitbaum/speechkit/pull/2 * docs: on npm since 2026-09-25 by @catomean in https://github.com/bitbaum/speechkit/pull/3 * chore: add the fleet package template files this repo is missing (dependabot.yml, git-release.yml, release.yml) by @catomean in https://github.com/bitbaum/speechkit/pull/4 * chore: add the fleet package template files this repo is missing (AGENTS.md, CLAUDE.md) by @catomean in https://github.com/bitbaum/speechkit/pull/6 * chore: add the fleet package template files this repo is missing (release-notify.yml) by @catomean in https://github.com/bitbaum/speechkit/pull/7 * docs: record verified package release history by @catomean in https://github.com/bitbaum/speechkit/pull/8 * ci(publish): the fleet's one publish.yml, with a no-publish check of the npm link by @catomean in https://github.com/bitbaum/speechkit/pull/9 * docs(agents): the org rules block, generated from bitbaum/fleet by @catomean in https://github.com/bitbaum/speechkit/pull/10 * chore(deps): dependabot leaves TypeScript 7 alone until typescript-eslint supports it by @catomean in https://github.com/bitbaum/speechkit/pull/11 * chore(deps-dev): bump the dev group with 5 updates by @dependabot[bot] in https://github.com/bitbaum/speechkit/pull/12

    New Contributors

    * @dependabot[bot] made their first contribution in https://github.com/bitbaum/speechkit/pull/12

    Full Changelog: https://github.com/bitbaum/speechkit/compare/v1.0.0...v1.0.1

Recent source changes

Repository activity can include unreleased work; it is not a list of deployed changes.

  1. chore(deps-dev): bump the dev group with 2 updates (#16)
  2. docs(agents): the org rules block, generated from bitbaum/fleet (#15)
  3. chore(deps-dev): bump the dev group with 2 updates (#14)
  4. docs(agents): the org rules block, generated from bitbaum/fleet (#13)
  5. release v1.0.1
  6. chore(deps-dev): bump the dev group with 5 updates (#12)
  7. chore(deps): dependabot leaves TypeScript 7 alone until typescript-eslint supports it (#11)
  8. docs(agents): the org rules block, generated from bitbaum/fleet (#10)
All releases · All tags

Where it is declared

Linked products declare this package in their manifests. A declaration alone does not verify every feature, version or deployed integration.

Sources and verification

Install commands and declared consumers come from Fleet’s generated registry. Documentation and release notes come from the package repository. The catalogue does not certify production journey coverage.

Documentation from source commit 243aab245847 · 2026-11-08. Source documentation can include work beyond the registry release.

Package verification runs