HiVoicy TTS API can convert any text to voice. (English, French and Persian).You can try it online on our website.
**The maximum length of a request can be 250 characters
**Support French , English & Persian (more languages soon)
**Human-like natural sounding voices
tts-text to speech-type to voice-text to voice-voice
import requests
api_url = 'https://text-to-speech5.p.rapidapi.com/api/tts'
api_key = 'Your API Key'
params= {"tech": "deep", "text": "hello world.", "language": "en"}
header = {
"x-rapidapi-host": "text-to-speech5.p.rapidapi.com",
"x-rapidapi-key": api_key,
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(api_url, params=params, headers=header)
#download and save mp3 file on disk
with open("test.mp3", "wb") as f:
f.write(response.content)
####File output
If you get a http OK 200
message, you can download the audio file as a byte array
.