Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,9 @@ from scipy.io import wavfile
|
|
| 40 |
|
| 41 |
import subprocess
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
| 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'
|