0

I'm trying to add silence inbetween to tts genarated voice, but cann't achieve this. the following code, merge the three tts but the silence couldn't be built:

Code fragment:

from gtts import gTTS

tts_en = gTTS('hello', lang='en')
tts_empty = gTTS('   ', lang='en') # trying to join silence with help of blank, but this doesn't work!!
tts_fr = gTTS('bonjour', lang='fr')


with open('hello_bonjour.mp3', 'wb') as f:
    tts_en.write_to_fp(f)
    tts_empty.write_to_fp(f) # Silence segment
    tts_fr.write_to_fp(f)
mimo2202
  • 1
  • 1

0 Answers0