Skip to main content
If your voice bot runs on Pipecat, install our integration and add one service to your pipeline.
pip install pipecat-mirai works too. You need Pipecat 1.8.1 or newer and Python 3.11 or newer.

Add it to your pipeline

Pick ashu, neha, shruti or sameer as the voice (you can hear them here). Audio comes out at your pipeline’s sample rate, so a phone call gets 8 kHz audio with nothing extra to set up. When the caller interrupts, the service stops the request straight away.

On phone calls

If your bot reaches callers through a websocket transport (Twilio, Plivo, Exotel or Telnyx), add one more line after you create the transport:
Pipecat normally sends audio to the phone line at exactly real time. If your server is busy for a moment, the line runs out of audio and the caller hears the voice break up. With apply_output_lead, Pipecat sends up to 0.4 seconds ahead, so short slowdowns on your server never reach the caller. In our test with 10 calls on one server, breaks stretched the bot’s speech by 29% with stock Pipecat and by 0.01% with this line added. It works the same whichever TTS you use.

Check that it works

This speaks one line through a real Pipecat pipeline and saves it as hello.wav. It uses a few paise of credit.

Moving from OpenAITTSService

If you set Mirai up through Pipecat’s OpenAITTSService with the VALID_VOICES workaround, replace it with MiraiTTSService. You can delete the voice-list patch, and the 24 kHz warning goes away. Your key, voices and billing stay the same.

pipecat-mirai on GitHub

Source, a Twilio phone-bot example and the phone-call benchmark.

TTS quickstart

Keys, limits, request logs and billing for text to speech.