https://retellai.com/?utm_source=discord&utm_medium=seo logo
new to retell...
# ❓・bug-report
j
looking in the docs for server events like vapi has. i see that there is call_start and call_end and i think i saw an error message as well. is that all? i ask because i use a lot or the evet that vapi emits to do things like fire animation on their volume change event, etc. forgive me if its an obvious question, just getting into the docs this morning. vapi has disappointed me too much and i was told to check yall out. plz and ty
e
https://docs.retellai.com/make-calls/web-call For web calls, Retell provides several events you can listen to: Basic call events: call_started - when call begins (1) call_ended - when call ends Agent speech events (useful for animation): agent_start_talking - when agent begins speaking agent_stop_talking - when agent finishes speaking Audio and transcript events: audio - real-time PCM audio bytes (only if emitRawAudioSamples is enabled) update - contains real-time transcript updates metadata - for receiving metadata during calls error - for handling error events Here's how you can implement these listeners: retellWebClient.on("call_started", () => { console.log("call started"); }); retellWebClient.on("call_ended", () => { console.log("call ended"); setIsCallActive(false); }); // When agent starts talking for the utterance // useful for animation retellWebClient.on("agent_start_talking", () => { console.log("agent_start_talking"); }); // When agent is done talking for the utterance // useful for animation retellWebClient.on("agent_stop_talking", () => { console.log("agent_stop_talking"); }); // Real time pcm audio bytes being played back, in format of Float32Array // only available when emitRawAudioSamples is true retellWebClient.on("audio", (audio) => { // console.log(audio); }); // Update message such as transcript // You can get transcrit with update.transcript // Please note that transcript only contains last 5 sentences to avoid the payload being too large retellWebClient.on("update", (update) => { // console.log(update); }); retellWebClient.on("metadata", (metadata) => { // console.log(metadata); }); retellWebClient.on("error", (error) => { console.error("An error occurred:", error); // Stop the call retellWebClient.stopCall(); });
j
good stuff, my man. thx