UNPKG

echogarden

Version:

An easy-to-use speech toolset. Includes tools for synthesis, recognition, alignment, speech translation, language detection, source separation and more.

38 lines (37 loc) 1.71 kB
import * as API from './API.js'; import { AudioSourceParam, RawAudio } from '../audio/AudioUtilities.js'; import { Timeline } from '../utilities/Timeline.js'; import { WhisperPartCallback, type WhisperOptions } from '../recognition/WhisperSTT.js'; import { type EngineMetadata } from './Common.js'; import { type SpeechLanguageDetectionOptions } from './API.js'; import { type SubtitlesConfig } from '../subtitles/Subtitles.js'; import { type OpenAICloudSTTOptions } from '../recognition/OpenAICloudSTT.js'; import { type WhisperCppOptions } from '../recognition/WhisperCppSTT.js'; export declare function translateSpeech(input: AudioSourceParam, options: SpeechTranslationOptions, onPart?: WhisperPartCallback): Promise<SpeechTranslationResult>; export interface SpeechTranslationResult { transcript: string; timeline: Timeline; wordTimeline?: Timeline; sourceLanguage: string; targetLanguage: string; inputRawAudio: RawAudio; isolatedRawAudio?: RawAudio; backgroundRawAudio?: RawAudio; } export type SpeechTranslationEngine = 'whisper' | 'whisper.cpp' | 'openai-cloud'; export interface SpeechTranslationOptions { engine?: SpeechTranslationEngine; sourceLanguage?: string; targetLanguage?: string; crop?: boolean; isolate?: boolean; languageDetection?: SpeechLanguageDetectionOptions; subtitles?: SubtitlesConfig; vad?: API.VADOptions; sourceSeparation?: API.SourceSeparationOptions; whisper?: WhisperOptions; whisperCpp?: WhisperCppOptions; openAICloud?: OpenAICloudSTTOptions; } export declare const defaultSpeechTranslationOptions: SpeechTranslationOptions; export declare const speechTranslationEngines: EngineMetadata[];