UNPKG

audio-to-text-node

Version:

Backend audio file to text transcription using Web Speech API with Puppeteer

32 lines 1.24 kB
/** * Transcribes an audio file to text using the browser's speech recognition capabilities. * It splits the audio file into chunks, sets up audio routing, and launches a browser to perform the transcription. * @param filePath Path to the audio file to transcribe * @param options Transcription options * @returns A Promise that resolves to the transcribed text */ export declare function transcribeFromFile( /** * Audio file formats supported: https://ffmpeg.org/general.html#File-Formats */ filePath: string, options?: { /** * Language code for transcription (default: 'en-US'). * See supported languages: https://cloud.google.com/speech-to-text/docs/speech-to-text-supported-languages */ language?: string; /** * Path to the browser executable (Edge/Chrome/Chromium). * If not provided, will try to find it automatically. */ executablePath?: string; /** * Virtual speaker device name for PipeWire/PulseAudio (default: 'virtual_speaker'). */ speakerDevice?: string; /** * Virtual microphone device name for PipeWire/PulseAudio (default: 'virtual_microphone'). */ microphoneDevice?: string; }): Promise<string>; //# sourceMappingURL=transcriber.d.ts.map