AfricanVoices for Developers
To download the data and use our TTS systems, follow the instructions below.
Desktop OS
Flite works on Linux, Windows and Mac OS X. Follow the steps below to install it.
- Download and set up Festvox; Flite is one of the packages
- Download the voices of your choice or you can also download and use the voices on the fly.
Downloading on the fly
./bin/flite -voice http://festvox.org/flite/packed/flite-2.1/voices/cmu_us_aew.flitevox -f doc/alice
Using a local flite voice
./bin/flite -voice voices/cmu_us_ahw.flitevox -f doc/alice
More usage instructions on desktop usage can be found on Flite
GitHub page.
Android Developers
You can find the source code Flite TTS engine for Android on
Github
If you are developing an application and would like to use Flite for speech synthesis, you can
specify "edu.cmu.cs.speech.tts.flite" as the package name of the engine to use.
Curl/Python/Javascript
You can use curl/Python/Javascript to download the datasets and synthesizers using the steps below:
- Go to the resource you want to download on the website
- Copy the link address
- Use curl as below:
curl https://www.africanvoices.tech/static/app/datasets/ibb/ibb_lst.zip --output ibb_lst.zip
- To use Python, you can use requests/urlib/wget libraries.
Look at details on how to use each of the here We provide a demo on using requests:
import requests
URL = "https://www.africanvoices.tech/static/app/datasets/ibb/ibb_lst.zip"
response = requests.get(URL)
open("ibb_lst.zip", "wb").write(response.content)
The file will be stored in your working directory.
Use curl to generate voice by following the below steps:
- Go to the page of the language you want to synthesize
- On the synthesis section, choose a synthesizer and copy the id of the synthesizer:
- Collect the following that you will use to replace the variables below:
text: the text you want to synthesize
url: the url of the language eg https://www.africanvoices.tech/language/swa for Kiswahili
audio_format: either mp3 or wav
synth_id: id of the synthesize you obtained on the step above
- Use curl as below replacing the variables:
fname=$(curl -e -H -X POST -F 'synth_id=kis_wak_30' -F \
'text={TEXT}' -F 'audio_format={AUDIO_FORMAT}' {URL} \
| grep synth-audio \
| sed -e 's/.*src="\(.*\){AUDIO_FORMAT}.*/\1/')
curl https://www.africanvoices.tech"$fname"{AUDIO_FORMAT} --output out.{AUDIO_FORMAT}
Your file will be saved in out.{AUDIO_FORMAT}