Michel D.
03/01/2026, 1:27 AMAI Evy
03/01/2026, 1:27 AMAI Evy
03/01/2026, 1:28 AMjavascript
await retellWebClient.startCall({
accessToken: createCallResponse.access_token,
sampleRate: 24000, // (Optional) set sample rate of the audio capture and playback
// (Optional) device id of the mic.
captureDeviceId: "default",
// (Optional) device id of the speaker
playbackDeviceId:
"0ec1807fd0fe6e51b990660ec4e2ebb78sdfcba51e279815d00c423ce03407ff",
// (Optional) Whether to emit "audio" events that contain raw pcm audio bytes represented by Float32Array
emitRawAudioSamples: false,
}) ;
## Listen for Errors
Add error handling to catch issues:
javascript
retellWebClient.on("error", (error) => {
console.error("An error occurred:", error) ;
// Stop the call
retellWebClient.stopCall() ;
}) ;AI Evy
03/01/2026, 1:28 AMAI Evy
03/01/2026, 1:28 AMAI Evy
03/01/2026, 1:28 AM