React Native text to speech: from system voices to your own voice server
A React Native app can speak in three ways: with the voices of the phone, with audio files voiced in advance, or with a speech server that voices new text on demand. The phone’s voices are free and offline but sound different on every device; the other two give your app one recognizable voice.
SuperClonica gives you natural voices in 31 languages, free to try online, a free engine to voice the app’s lines on your computer and a Docker server for text that changes. This guide shows each approach in React Native and Expo.
Three ways to make an app speak
SuperClonica speaks 31 languages; Chinese is not supported yet, so a Chinese interface still needs another voice.
- expo-speech or react-native-tts: the voices installed on the phone, free and offline, different on every device, and they cannot save audio.
- Pre-voiced assets: every fixed line voiced once with SuperClonica and shipped in the app.
- A speech server: the app sends text to your SuperClonica server and plays the answer.
- Most apps mix them: assets for fixed lines, a server for user text, the system voice as a fallback.
Pick a voice free online
On the page of any voice, type a line of your app, 30 to 100 characters, choose the language and press Voice it. In a few seconds you hear whether it fits your app, with no account, also on your phone.
Pre-voiced lines with expo-audio
Name the files by the key you already use for translations, so every language has the same file names in its own folder.
- Install the free engine on your computer: python -m pip install superclonica-cpu.
- Voice each line: superclonica --text "Welcome back!" --voice F1 --lang en --output assets/voice/welcome.mp3.
- Play it with expo-audio: const player = useAudioPlayer(require('./assets/voice/welcome.mp3')); player.play();
- Assets work offline and add no delay; MP3 keeps a one-sentence line to a few dozen kilobytes.
A speech server for user text
For text that changes, such as chat messages, user notes or a tutor that answers, run the server on a machine you control: docker run -d -p 8000:8000 -v superclonica-models:/models superclonica/superclonica:cpu. Put it behind HTTPS and set SUPERCLONICA_API_KEY so only your app can call it. The app posts JSON with text, voice and lang to /synthesize and gets a WAV back; save it to a file with your file-system library and give the file to the audio player. Cache answers for texts that repeat: the same text, voice and seed always give the same file.
When the system voice is enough
The system voice is enough when the voice only has to be understood: reading a notification aloud, an accessibility helper or a prototype that must work without any network. Choose your own voice when it is part of the product, such as a tutor, a game character or a guided meditation. For an app you publish, use the ten stock voices, M1 to M5 and F1 to F5, free under the OpenRAIL-M license, or your own voice trained in the SuperClonica studio; fan-made character voices are not for store apps.