Skip to content

v0.20.0

Release date: 2026-11-17

This release checks wording attributed to a recording against the recording itself. Several speech-to-text engines hear a short clip around the quotation, and fixed rules decide whether they all heard it, agree on a correction, or disagree on a word that matters. One engine's transcript can't show which of its words are wrong; several engines hearing the same clip can.

Highlights

  • Quotations checked against audio — stt/verify locates a quotation in a timed transcript, clips it, has several engines hear the clip and compares what they heard
  • Deterministic decisions — agreed, corrected, disputed, notFound or insufficient, from token kinds and fixed rules, so the same hearings always give the same result
  • Clips for speech-to-text — audio/clip cuts 16 kHz mono WAV with ffmpeg

Added

Verification (stt/verify/)

  • Normalize turns text into comparable tokens: lower case, punctuation removed, contractions expanded, number words as digits, "%" as "percent", fillers dropped. Each token has a kind: number, negation, term, name, function or content; every kind except function is substantive.
  • Align and AlignWithin use an affine-gap alignment suited to quotations: a skipped run of the speaker's words costs about one edit, a misheard word costs less when it is spelled like the quoted one, and a quoted word left out costs most. Words heard across a marked elision cost nothing.
  • Locate finds wording in a timed transcript, with a score and the number of quoted words missing at each edge.
  • Compare decides from several hearings:
Decision When
agreed Every engine heard every quoted word, apart from function words where most agree with the quotation
corrected The engines agree with each other but not with the quotation
disputed They disagree on a substantive word, or none heard the first or last words
notFound The quotation could not be located
insufficient Too few engines produced a transcript

Stutters ("to, to") are ignored, split words ("work flow") are joined, and CompareOptions.Aliases accepts other ways of saying a term. - TranscribeAll has several engines transcribe one clip at once. Key words go only to engines not marked NoKeywords, and it returns ErrAllEnginesUseKeywords rather than give them to every engine. - Verifier.VerifyQuotes checks quotations end to end and returns a Report with the recording's SHA-256, the engines, the clip times and every decision. When no engine hears a quotation's first or last words, it widens the clip and listens again, up to two times. - Search looks for phrases across independent transcripts. Its statement says only how many transcripts have each phrase, never that the recording lacks it.

v := verify.Verifier{
    Engines: []verify.Engine{
        {Name: "deepgram", Provider: deepgram},
        {Name: "elevenlabs", Provider: elevenlabs},
        {Name: "openai", Provider: openai, NoKeywords: true},
    },
}
report, err := v.VerifyQuotes(ctx, "episode.mp3", verify.WordsFromTranscript(t), "deepgram",
    []verify.Quote{{ID: "q1", Text: "we can have the model run all the tests"}})

Clips (audio/clip/)

  • Clip(ctx, path, start, end) returns 16 kHz mono WAV. ffmpeg must be on PATH; ErrNoFFmpeg reports when it isn't. The WAV header carries real sizes, which ffmpeg leaves unset when writing to a pipe and some services reject.

Schema (schema/)

  • VerifyReportV1Schema, the verify report's JSON Schema, generated from its Go types by go run schema/gen/main.go. A test fails when the committed schema is out of date.

Documentation

Dependencies

  • Requires github.com/invopop/jsonschema v0.14.0, to generate the verify report schema.
  • Module dependencies updated.

Compatibility

No breaking changes. The new packages are additive.