Kevin676 commited on
Commit
1ead5ce
·
1 Parent(s): e680b97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  # !git clone https://github.com/Edresson/Coqui-TTS -b multilingual-torchaudio-SE TTS
2
 
 
3
  from TTS.utils.manage import ModelManager
4
  from TTS.utils.synthesizer import Synthesizer
5
 
@@ -199,7 +200,11 @@ def voice_conversion(apikey, ta, audio, choice1):
199
 
200
  messages.append({"role": "assistant", "content": chat_response})
201
 
202
- tts.tts_to_file(chat_response + "。", file_path="output.wav")
 
 
 
 
203
 
204
  target_audio = 'target.wav'
205
  reference_audio = 'reference.wav'
 
1
  # !git clone https://github.com/Edresson/Coqui-TTS -b multilingual-torchaudio-SE TTS
2
 
3
+ import tempfile
4
  from TTS.utils.manage import ModelManager
5
  from TTS.utils.synthesizer import Synthesizer
6
 
 
200
 
201
  messages.append({"role": "assistant", "content": chat_response})
202
 
203
+ wavs = synthesizer.tts(chat_response + "。")
204
+
205
+ synthesizer.save_wav(wavs, "output.wav")
206
+
207
+ #tts.tts_to_file(chat_response + "。", file_path="output.wav")
208
 
209
  target_audio = 'target.wav'
210
  reference_audio = 'reference.wav'