Is there any way to play an audio file
# general-english
a
Is there any way to play an audio file while agents make tool calls? Either dashboard or API? Example: "Can you please schedule a meeting?" Agent: " Sure thing, one second." Tool Call triggers mp3 or wav file (public URL or on vapi?) wav file play a hold music until tool call complete.
k
By sending a command to the controlUrl while Vapi doesn’t directly stream audio files, you can simulate it via telephony provider support or by playing audio from a public URL externally..
a
Ok will give that a try. Thank you!
I ended up using the client messages in the SDK. It worked well. I simply checked for all tool calls. // Check for tool calls starting const hasNewToolCall = message.messages?.some((msg: { role: string; toolCalls?: any[] }) => msg.role === "tool_calls" && (msg.toolCalls && msg.toolCalls.length > 0) ); // Check for tool call results/completion const hasToolResult = message.messages?.some((msg: { role: string; content?: string }) => msg.role === "tool_call_result" || (msg.role === "tool" && msg.content !== "Tool Result Still Pending But Proceed Further If Possible.") );
Example in case anyone else searches for this
k
Thank you
3 Views