UNPKG

@lobehub/tts

Version:

A high-quality & reliable TTS React Hooks library

13 lines (12 loc) 496 B
//#region src/server/createOpenaiAudioTranscriptions.ts const createOpenaiAudioTranscriptions = async ({ payload, openai }) => { const { speech, options } = payload; const file = new File([speech], `${Date.now()}.${options.mineType.extension}`, { type: options.mineType.mineType }); return await openai.audio.transcriptions.create({ file, model: options.model, prompt: options.prompt || "" }, { headers: { Accept: "*/*" } }); }; //#endregion export { createOpenaiAudioTranscriptions };