GUIDE

Twilio custom voice: play your own text-to-speech audio

Twilio’s Say verb reads text in a call with the built-in Amazon Polly and Google voices. It is convenient, and it means your IVR, your reminders and your hold message sound like thousands of other companies.

The Play verb plays any audio file instead. With the free SuperClonica engine you voice the prompts offline, in a stock voice, a voice trained from your own speaker or a character, and Twilio plays them in the call. This guide shows how to make phone-ready files, serve them so Twilio caches them, and when Say is still the right tool.

Say or Play

Use Play for every prompt that is the same for all callers, and keep Say for text that changes per call, such as an order number.

  • Say: Twilio speaks text at call time with its built-in voices; nothing to host.
  • Play: Twilio downloads an audio file from your URL and plays it, any voice you like.
  • Play accepts MP3, WAV, AIFF, GSM and μ-law audio, and can loop a file until the caller hangs up.
  • SuperClonica speaks 31 languages; Chinese is not supported yet.

Hear the voices free online

On the page of any voice, type one of your prompts, 30 to 100 characters, choose the language and press Voice it. In a few seconds you hear how your line could sound, with no account.

Make phone-ready files

An 8 kHz μ-law WAV of a ten-second prompt takes about 80 KB, so even a large menu downloads in an instant.

  • Install the engine: python -m pip install superclonica-cpu.
  • In Python, create the engine once with tts = Superclonica(), then voice a prompt and save it for the phone: audio, rate = tts.synthesize("Thanks for calling. All our agents are busy, please hold.", "F1", "en"); sf.write("hold.wav", resample_poly(audio, 8000, rate), 8000, subtype="ULAW").
  • This needs soundfile and resample_poly from scipy.signal, both installed with the engine.
  • Twilio transcodes all call audio; its docs warn that a 128 kbps MP3 can sound worse than a low-bitrate lossless file, which an 8 kHz μ-law WAV is.

Serve and play the prompts

Host the files over HTTPS, on your server or in object storage, with ETag or Last-Modified headers so Twilio caches them after the first play. With Twilio’s Python helper library the TwiML is two lines: r = VoiceResponse(); r.play('https://example.com/audio/hold.wav', loop=0), and the loop value 0 repeats the file until the call ends. For text that changes per call, run the SuperClonica HTTP server next to your app and voice the line before you answer the webhook: a short phrase takes well under a second on a desktop processor, so cache what repeats.

Rules for automated calls

In the United States, the FCC ruled in 2024 that AI-generated voices in robocalls count as artificial voices under the TCPA, so automated calls need the same consent as any prerecorded message. Use a voice you have the rights to, such as the ten stock voices of the model or your own voice trained from a speaker who agreed, never a voice that imitates a real person, and say that the caller is talking to an automated system.