Create tts.py
Browse files- utils/tts.py +9 -0
utils/tts.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from TTS.api import TTS
|
| 2 |
+
|
| 3 |
+
# Tek ses modeli örneği
|
| 4 |
+
tts = TTS(model_name="tts_models/en/ljspeech/tacotron2-DDC", progress_bar=False, gpu=False)
|
| 5 |
+
|
| 6 |
+
def synthesize_speech(text, lang="en"):
|
| 7 |
+
tts_file_path = "/tmp/out.wav"
|
| 8 |
+
tts.tts_to_file(text=text, file_path=tts_file_path)
|
| 9 |
+
return tts_file_path
|