0

I'm trying to make a conversation between two text-to-speech voices using gtts. I'm trying to make one be english sound french. I'm having trouble layering one voice to talk then another to talk right after it like an actual dialog. I was thinking about splitting up the dialog into two sentences, but they just talk over each other when I do try to merge them unless I somehow know exactly when each is done with a sentence.

from gtts import gTTS

mytext = "Mary: Can I stay up for tonight? Sarah: No, you have school tomorrow. Mary: But all my friends are staying up! Sarah: No, rules are rules, no staying up on a school day. Mary: What if I do dishes for a week? Sarah: Deal."


language = 'fr'
language2 = 'en'
myobj = gTTS(text=mytext, lang=language, slow=False)
#myobj2 = gTTS(text = mytext2, lang=language2, slow=False) #I split mytext into just Marys talk and they just talked over each other.
myobj.save("testing.mp3")
Electro
  • 17
  • 8

0 Answers0