Skip to content

arabic text #397

Answered by pndurette
lazezo2 asked this question in Q&A
Feb 15, 2023 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

By default it's trying to read that in English—which it can't—so you need to specify the language to use, in your case:

from gtts import gTTS
-tts = gTTS('اهلا')
+tts = gTTS('اهلا', lang='ar')
tts.save('hello.mp3')

Using ar for Arabic should do the trick!

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@lazezo2
Comment options

Answer selected by lazezo2
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants