Update app.py
Browse files
app.py
CHANGED
@@ -68,7 +68,12 @@ async def respond(audio):
|
|
68 |
user = transcribe(audio)
|
69 |
reply = model(user)
|
70 |
reply2 = number_to_words(reply)
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
72 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
73 |
tmp_path = tmp_file.name
|
74 |
await communicate.save(tmp_path)
|
@@ -97,13 +102,10 @@ async def generate1(prompt):
|
|
97 |
output += response.token.text
|
98 |
|
99 |
voices = await VoicesManager.create()
|
100 |
-
voice = voices.find(Gender="Male", Locale="
|
101 |
|
102 |
-
|
103 |
communicate = edge_tts.Communicate(output, random.choice(voice)["Name"])
|
104 |
-
|
105 |
-
|
106 |
-
# communicate = edge_tts.Communicate(output)
|
107 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
108 |
tmp_path = tmp_file.name
|
109 |
await communicate.save(tmp_path)
|
|
|
68 |
user = transcribe(audio)
|
69 |
reply = model(user)
|
70 |
reply2 = number_to_words(reply)
|
71 |
+
|
72 |
+
voices = await VoicesManager.create()
|
73 |
+
voice = voices.find(Gender="Male", Locale="en-GB")
|
74 |
+
|
75 |
+
communicate = edge_tts.Communicate(reply2, random.choice(voice)["Name"])
|
76 |
+
|
77 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
78 |
tmp_path = tmp_file.name
|
79 |
await communicate.save(tmp_path)
|
|
|
102 |
output += response.token.text
|
103 |
|
104 |
voices = await VoicesManager.create()
|
105 |
+
voice = voices.find(Gender="Male", Locale="en-GB")
|
106 |
|
|
|
107 |
communicate = edge_tts.Communicate(output, random.choice(voice)["Name"])
|
108 |
+
|
|
|
|
|
109 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
110 |
tmp_path = tmp_file.name
|
111 |
await communicate.save(tmp_path)
|