DSatishchandra commited on
Commit
a511564
1 Parent(s): b618fc5

Update order_assistant.py

Browse files
Files changed (1) hide show
  1. order_assistant.py +6 -6
order_assistant.py CHANGED
@@ -57,12 +57,12 @@ class OrderAssistant:
57
  return "Sorry, I'm having trouble reaching the service"
58
 
59
  async def text_to_speech(self, text):
60
- # Update rate to "+0%" (or use any non-zero value like "+10%" or "-5%")
61
- communicate = edge_tts.Communicate(text, "en-US-AriaNeural", rate="+0%", pitch="0Hz")
62
- with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_file:
63
- tmp_path = tmp_file.name
64
- await communicate.save(tmp_path)
65
- return tmp_path
66
 
67
  async def food_order_assistant(self, audio_input, food_type):
68
  greeting_text = "Welcome to the restaurant! What would you like to order today? Are you looking for Vegan, Halal, or Guilt-Free options?"
 
57
  return "Sorry, I'm having trouble reaching the service"
58
 
59
  async def text_to_speech(self, text):
60
+ # Ensure the body of the function is correctly indented
61
+ communicate = edge_tts.Communicate(text, "en-US-AriaNeural", rate="+0%", pitch="0Hz")
62
+ with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_file:
63
+ tmp_path = tmp_file.name
64
+ await communicate.save(tmp_path)
65
+ return tmp_path
66
 
67
  async def food_order_assistant(self, audio_input, food_type):
68
  greeting_text = "Welcome to the restaurant! What would you like to order today? Are you looking for Vegan, Halal, or Guilt-Free options?"