probably non-pythonic exception handling in 01
This commit is contained in:
@@ -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,6 +52,8 @@ 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()
|
||||||
|
|||||||
Reference in New Issue
Block a user