audio-transcripter
Version:
Lightweight TypeScript library for transcribing audio files using Google Gemini 2.0 models. Supports local files, remote URLs, and Blobs.
22 lines (21 loc) • 676 B
TypeScript
import { TranscriptionStyle } from "../utils/prompt";
export type TranscriptionSources = "local" | "remote" | "buffer";
export interface TranscribeAudioOptions {
style?: TranscriptionStyle;
language?: string | null;
context?: string | null;
sourceType?: TranscriptionSources;
}
export interface TranscriptionConfig {
audioFile: string;
style?: TranscriptionStyle;
language?: string | null;
verbose?: boolean;
timeout?: number;
}
export type KnownAudioExtension = ".mp3" | ".wav" | ".aac" | ".flac" | ".ogg" | ".webm" | ".weba";
export type RunTranscriptionResult = {
success: boolean;
transcription?: string;
error?: string;
};