voipi - Free text-to-speech for your AI Agents or CLI
voipi lets you quickly convert text-to-speech which you can use in your app for free.
Under the hood, it uses multiple providers. And it is pretty fast as well.
How to get started?
# Speak
npx voipi speak 'Hello world'
# Write to a file
npx voipi speak 'Hi' -o hello.mp3
You can also use it programatically (based on docs)
import { VoiPi } from "voipi";
const voice = new VoiPi();
// Speak text
await voice.speak("Hello world!");
// With a prioritized voice list (first available wins)
await voice.speak("Hello!", { voice: ["Samantha", "en-US-AriaNeural"], rate: 1.5 });
// Save to file
await voice.save("Hello!", "output.mp3");
// Get audio data with duration
const audio = await voice.toAudio("Hello world!");
console.log(`Duration: ${audio.duration}s`);
// List available voices
const voices = await voice.listVoices();