Kevin676 commited on
Commit
e2424be
·
1 Parent(s): bdce0e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -40,7 +40,9 @@ from scipy.io import wavfile
40
 
41
  import subprocess
42
 
43
- from gtts import gTTS
 
 
44
 
45
  import whisper
46
  model = whisper.load_model("small")
@@ -195,6 +197,8 @@ def voice_conversion(apikey, ta, audio, choice1):
195
  tts = gTTS(chat_response, lang='zh-CN')
196
  tts.save("output.wav")
197
 
 
 
198
  target_audio = 'target.wav'
199
  reference_audio = 'reference.wav'
200
  driving_audio = 'driving.wav'
 
40
 
41
  import subprocess
42
 
43
+ os.system(pip install -U numpy==1.21)
44
+ from TTS.api import TTS
45
+ tts = TTS(model_name="tts_models/zh-CN/baker/tacotron2-DDC-GST", progress_bar=False, gpu=True)
46
 
47
  import whisper
48
  model = whisper.load_model("small")
 
197
  tts = gTTS(chat_response, lang='zh-CN')
198
  tts.save("output.wav")
199
 
200
+ tts.tts_to_file(chat_response + "。", file_path="output.wav")
201
+
202
  target_audio = 'target.wav'
203
  reference_audio = 'reference.wav'
204
  driving_audio = 'driving.wav'