SpeechInput (input/speech-input.ts)

airi · packages/core-agent/src/voice/input/speech-input.ts · typescript · MIT
voice

Manages speech input lifecycle, handling transcription events, patches, and speaker evidence.

// Source: https://github.com/moeru-ai/airi | License: MIT | Copyright 2024-PRESENT Neko Ayaka
// Provided via justclaw.it.com; keep this notice with the code.
import type { TranscriptEdit, TranscriptionEvent, WriteResult } from './transcript'
import type { SpeakerEvidence, TranscriptDocument } from './types'

import { Transcript } from './transcript'

/**
 * The document of one accepted speech input.
 *
 * State model:
 * - Open: provider updates, manual corrections, and speaker evidence change the document. Each change increases
 *   `document.version` and notifies listeners synchronously.
 * - Transcribed: `finishTranscription` freezes provider text and speaker evidence. Corrections still apply, so
 *   finalization stages can patch the complete text.
 * - Sealed: `seal` rejects every w

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key