Kevin676 commited on
Commit
f045577
·
1 Parent(s): c20180e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,6 +1,5 @@
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
 
@@ -202,15 +201,15 @@ def voice_conversion(apikey, ta, audio, choice1):
202
 
203
  wavs = synthesizer.tts(chat_response + "。")
204
 
205
- with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
206
- synthesizer.save_wav(wavs, fp)
207
  #tts.tts_to_file(chat_response + "。", file_path="output.wav")
208
 
209
  target_audio = 'target.wav'
210
  reference_audio = 'reference.wav'
211
  driving_audio = 'driving.wav'
212
 
213
- rate1, data1 = wavfile.read(fp)
214
 
215
  write(target_audio, ta[0], ta[1])
216
  write(reference_audio, rate1, data1)
 
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
 
 
201
 
202
  wavs = synthesizer.tts(chat_response + "。")
203
 
204
+
205
+ synthesizer.save_wav(wavs, "output.wav")
206
  #tts.tts_to_file(chat_response + "。", file_path="output.wav")
207
 
208
  target_audio = 'target.wav'
209
  reference_audio = 'reference.wav'
210
  driving_audio = 'driving.wav'
211
 
212
+ rate1, data1 = wavfile.read("output.wav")
213
 
214
  write(target_audio, ta[0], ta[1])
215
  write(reference_audio, rate1, data1)