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
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: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
hello.wav. It uses a few paise of credit.
Moving from OpenAITTSService
If you set Mirai up through Pipecat’sOpenAITTSService 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.