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
Kings_big💫
05/27/2025, 11:34 PM
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
ACloudCenter (Josh E.)
05/27/2025, 11:45 PM
Ok will give that a try. Thank you!
ACloudCenter (Josh E.)
05/28/2025, 9:29 AM
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.")
);