Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
perf: Enhance a bit the voice recognition
Clémence Lesné420f2e2ac890
diff --git a/app/helpers/call_llm.py b/app/helpers/call_llm.pyindex 0feba23..e329d1e 100644--- a/app/helpers/call_llm.py+++ b/app/helpers/call_llm.py@@ -13,6 +13,7 @@ from azure.cognitiveservices.speech.audio import AudioStreamFormat, PushAudioInpfrom azure.communication.callautomation.aio import CallAutomationClientfrom openai import APIErrorfrom pydub import AudioSegment+from pydub.effects import high_pass_filter, low_pass_filterfrom app.helpers.call_utils import (handle_clear_queue,@@ -635,6 +636,10 @@ async def _in_audio( # noqa: PLR0913# Confirm ASAP that the event is processedin_stream.task_done()+ # Apply high-pass and low-pass filters in a simple attempt to reduce noise+ in_audio = high_pass_filter(in_audio, 200)+ in_audio = low_pass_filter(in_audio, 3000)+# Always add the audio to the bufferassert isinstance(in_audio.raw_data, bytes)out_stream.write(in_audio.raw_data)