Isidorophp commited on
Commit
0e71381
·
verified ·
1 Parent(s): 0ade2f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
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
- communicate = edge_tts.Communicate(reply2)
 
 
 
 
 
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="es-AR")
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)