Fixed audio option
This commit is contained in:
@@ -63,14 +63,14 @@ async def main(user, message_text, audio):
|
||||
async with client:
|
||||
audio_name, audio_duration = generate_audio(message_text)
|
||||
|
||||
logging.info(f"Calling {user}")
|
||||
call = await voip_service.start_call(user)
|
||||
logging.info(f"Sending message to: {user}")
|
||||
await client.send_message(user, message_text)
|
||||
|
||||
try:
|
||||
if audio == 'yes':
|
||||
logging.info(f"Calling {user}")
|
||||
call = await voip_service.start_call(user)
|
||||
call.play(f"/data/audio/{audio_name}.raw")
|
||||
except Exception as e:
|
||||
logging.error(f"Error: {e}")
|
||||
call_has_ended = False
|
||||
|
||||
@call.on_call_state_changed
|
||||
@@ -94,6 +94,8 @@ async def main(user, message_text, audio):
|
||||
except Exception as e:
|
||||
logging.error(f"There was an error during the call: {e}")
|
||||
break
|
||||
except Exception as e:
|
||||
logging.error(f"Error: {e}")
|
||||
|
||||
while True:
|
||||
time.sleep(5)
|
||||
|
||||
Reference in New Issue
Block a user