arm-inas commited on
Commit
5a6a4e3
·
verified ·
1 Parent(s): 91620fb

Create tts.py

Browse files
Files changed (1) hide show
  1. 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