Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Translate spoken audio in any language to English text, step by step.
import createRvencClient from "@premai/api-sdk"; import fs from "fs"; const client = await createRvencClient({ apiKey: process.env.PREM_API_KEY, clientKEK: process.env.CLIENT_KEK }); const audioFile = fs.createReadStream("./audio-spanish.mp3"); const translation = await client.audio.translations.create({ file: audioFile, model: "openai/whisper-large-v3", }); console.log(translation.text);
const translation = await client.audio.translations.create({ file: audioFile, model: "openai/whisper-large-v3", prompt: "This is a business meeting discussing quarterly results and future plans.", }); console.log(translation.text);
const translation = await client.audio.translations.create({ file: audioFile, model: "openai/whisper-large-v3", response_format: "verbose_json", }); console.log({ text: translation.text, language: translation.language, duration: translation.duration, });