Add try
This commit is contained in:
3
main.py
3
main.py
@@ -148,10 +148,13 @@ def tts(input_text, model=VOICE_MODEL):
|
|||||||
else:
|
else:
|
||||||
logger.info('Request failed with status code', response.status_code)
|
logger.info('Request failed with status code', response.status_code)
|
||||||
|
|
||||||
|
try:
|
||||||
# Use aplay to play the audio
|
# Use aplay to play the audio
|
||||||
os.system('aplay ' + output_file_path)
|
os.system('aplay ' + output_file_path)
|
||||||
# remove the audio file
|
# remove the audio file
|
||||||
os.remove(output_file_path)
|
os.remove(output_file_path)
|
||||||
|
except:
|
||||||
|
logger.info('Unable to play audio')
|
||||||
|
|
||||||
# Function to analyze the user input and pick the next action to do
|
# Function to analyze the user input and pick the next action to do
|
||||||
def needs_to_do_action(user_input,agent_actions={}):
|
def needs_to_do_action(user_input,agent_actions={}):
|
||||||
|
|||||||
Reference in New Issue
Block a user