|
@@ -241,9 +241,8 @@ def file_prepare(name, name_hash,text_content,image_urls):
|
|
|
text_file.close()
|
|
|
print("text file made")
|
|
|
#make mp3
|
|
|
- language = 'zh-tw'
|
|
|
- output = gTTS(text=text_content, lang=language, slow=False)
|
|
|
- output.save(dir_sound+name_hash+".mp3")
|
|
|
+ tts = zhtts.TTS()
|
|
|
+ tts.text2wav(text_content,dir_sound+name_hash+".mp3")
|
|
|
print("mp3 file made")
|
|
|
#make title as image
|
|
|
txt2image(name, dir_title+name_hash+".png")
|
|
@@ -311,8 +310,8 @@ def file_prepare_v2(name, name_hash,text_content,image_urls):
|
|
|
language = 'zh-tw'
|
|
|
txt_idx = 0
|
|
|
for txt in text_content:
|
|
|
- output = gTTS(text=txt, lang=language, slow=False)
|
|
|
- output.save(dir_sound+name_hash+"/"+str(txt_idx)+".mp3")
|
|
|
+ tts = zhtts.TTS()
|
|
|
+ tts.text2wav(txt,dir_sound+name_hash+"/"+str(txt_idx)+".mp3")
|
|
|
txt_idx+=1
|
|
|
print("mp3 file made")
|
|
|
#make title as image
|