asr/types.ts

pocketpal-ai · src/services/asr/types.ts · typescript · MIT
voice

TypeScript definitions for an ASR engine, covering tiers, download states, and transcription interfaces.

// Source: https://github.com/a-ghorbani/pocketpal-ai | License: MIT | Copyright 2024 Asghar Ghorbani
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * ASR (automatic speech recognition) service types.
 *
 * The whisper runtime is abstracted behind `AsrEngine` so the rest of the app
 * never touches `whisper.rn` directly. Model download/install mirrors the TTS
 * neural-engine pattern (per-tier on-disk install + version sentinel).
 */

/** Whisper model size tiers offered to the user. */
export type AsrTier = 'base' | 'small' | 'large-turbo';

/**
 * Model download lifecycle for a tier. Reuses the TTS `NeuralDownloadState`
 * shape verbatim. Derived from `isInstalled` on init — never persisted; the
 * source of truth is the file system.
 */
export type AsrDownloadStat

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

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

Get a free API key