Send Audio • AI Agent SDK

send_audio: Send audio data (sync wrapper).

send_audio

Method

</div>

This is a method of the RealtimeAgent class in the realtime_agent module.

Send audio data (sync wrapper).

Signature

python
def send_audio(audio_data: bytes) -> bool

Parameters

ParamField bytes

Raw audio bytes (PCM16 format)

Returns

ResponseField bool

True if sent successfully

Uses

  • asyncio.get_running_loop
  • asyncio.get_event_loop
  • loop.run_until_complete
  • asend_audio
  • asyncio.new_event_loop
  • asyncio.set_event_loop

Source

View on GitHub

praisonaiagents/agent/realtime_agent.py at line 373


Related Documentation