Compare commits

...

1 Commits

Author SHA1 Message Date
Kwindla Hultman Kramer
2d3f718733 probably non-pythonic exception handling in 01 2024-03-08 10:41:28 -08:00

View File

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