probably non-pythonic exception handling in 01

This commit is contained in:
Kwindla Hultman Kramer
2024-03-08 10:41:28 -08:00
parent 824df8ca7c
commit 2d3f718733

View File

@@ -44,19 +44,22 @@ async def main(room_url):
@transport.event_handler("on_participant_joined")
async def on_participant_joined(transport, participant):
nonlocal tts
if participant["info"]["isLocal"]:
return
try:
if participant["info"]["isLocal"]:
return
await tts.say(
"Hello there, " + participant["info"]["userName"] + "!",
transport.send_queue,
)
await tts.say(
"Hello there, " + participant["info"]["userName"] + "!",
transport.send_queue,
)
except Exception as e:
print("Exception while speaking:", e)
# wait for the output queue to be empty, then leave the meeting
await transport.stop_when_done()
await transport.run()
del(tts)
del (tts)
if __name__ == "__main__":