orate
Version:
The AI toolkit for speech.
30 lines (27 loc) • 1.33 kB
text/typescript
import { JigsawStack as JigsawStack$1 } from 'jigsawstack';
type JigsawStackType = ReturnType<typeof JigsawStack$1>;
type STTParams = Parameters<JigsawStackType['audio']['speech_to_text']>['0'];
type TTSParams = Parameters<JigsawStackType['audio']['text_to_speech']>['0'];
declare class JigsawStack {
private apiKey;
constructor(apiKey?: string);
private createProvider;
/**
* Creates a speech-to-text transcription function using JigsawStack
* @param {Omit<STTParams, 'url'>} options - Additional options for the transcription
* @returns {Function} Async function that takes audio url and returns transcribed text
*/
stt(options?: Omit<STTParams, 'url'>): {
generate: (audio: File) => Promise<string>;
};
/**
* Creates a text-to-speech synthesis function using JigsawStack TTS
* @param {TTSParams["accent"]} voice - The voice to use for synthesis. Defaults to 'en-US-female-27'
* @param {Omit<TTSParams, 'text' | 'accent'>} properties - Additional properties for the synthesis request
* @returns {Function} Async function that takes text and returns synthesized audio
*/
tts(voice?: TTSParams['accent'], properties?: Omit<TTSParams, 'text' | 'accent'>): {
generate: (prompt: string) => Promise<File>;
};
}
export { JigsawStack };