NEXAS commited on
Commit
56eb5c3
1 Parent(s): bc5300c

Update utils/tts.py

Browse files
Files changed (1) hide show
  1. utils/tts.py +7 -7
utils/tts.py CHANGED
@@ -2,20 +2,20 @@ import requests
2
  import os
3
  from dotenv import load_dotenv
4
  import json
5
- import pyttsx3
6
 
7
  load_dotenv()
8
  API_KEY = os.getenv("DG_API_KEY")
9
  AUDIO_FILE=r".\media\ouput_file.mp3"
10
 
11
- engine = pyttsx3.init()
12
- voices = engine.getProperty('voices')
13
- engine.setProperty('voice', voices[1].id)
14
 
15
 
16
- def text_to_speech2(llm_response):
17
- engine.save_to_file(llm_response, AUDIO_FILE)
18
- engine.runAndWait()
19
 
20
 
21
  def text_to_speech(llm_response):
 
2
  import os
3
  from dotenv import load_dotenv
4
  import json
5
+ #import pyttsx3
6
 
7
  load_dotenv()
8
  API_KEY = os.getenv("DG_API_KEY")
9
  AUDIO_FILE=r".\media\ouput_file.mp3"
10
 
11
+ #engine = pyttsx3.init()
12
+ #voices = engine.getProperty('voices')
13
+ #engine.setProperty('voice', voices[1].id)
14
 
15
 
16
+ #def text_to_speech2(llm_response):
17
+ # engine.save_to_file(llm_response, AUDIO_FILE)
18
+ # engine.runAndWait()
19
 
20
 
21
  def text_to_speech(llm_response):