mcut

Transcription

Transcript normalization, captions, subtitles, and providers.

@mcut/transcription defines the shared transcript shape and helpers for turning transcripts into captions. Provider packages adapt AssemblyAI, the Vercel AI SDK, and local Whisper into that shape.

Use the core package for caption generation and subtitle output. Use provider packages when you need to create transcripts.

bun add @mcut/transcription
import { toCaptionElements } from "@mcut/transcription"

const captions = toCaptionElements(transcript)

Vocabulary

Pass vocabulary to transcribe with names and terms the audio contains, usually the project's vocabulary, which updateProject sets. The AI SDK adapter ignores it, so pass hints there through providerOptions.

  • Local Whisper gets the terms as a decoder prompt after <|startofprev|>, the way the reference decoder builds one. Like that decoder, it keeps the last 223 prompt tokens, half the 448-token text context less one. When speech is left after the last prompted word in a window, it decodes that window again without the prompt and keeps whichever result reaches further. Pass language as a code such as en, since a language name leaves the decoder unprompted.
  • AssemblyAI gets them as keyterms_prompt, which replaced word_boost. Terms past 1000 words in total are dropped, and phrases longer than six words are left out, the limit the AI SDK AssemblyAI provider documents.
await provider.transcribe({ audio }, { vocabulary: ["Grokbot", "Karen X. Cheng", "mcut"] })

Read next:

On this page