certified dirtiboi
05/30/2025, 9:43 PMvapiInstance.on('speech-end', () => {
console.log('speech-end');
setIsSpeaking(false);
// Mute after the first speech ends
vapiInstance.send({
type: 'control',
control: 'mute-assistant'
});
});
I'm not sure if I'm calling the send command in the right place, but my thought was that once the speech-end is triggered my mute-assistant command would run. I've also tried setting the send command outside of the .on method, but that doesn't work either
I'm working with the web sdk and here are some call logs:
- e45ad042-d13c-41a2-a5cc-6c0b0a19e009
- 75dd754b-455d-4d66-9b75-edab8959d1ca
Any help would be appreciated.Kings_big💫
05/31/2025, 7:15 AMcertified dirtiboi
05/31/2025, 2:59 PMlet hasMuted = false;
vapiInstance.on('speech-end', () => {
console.log('speech-end');
setIsSpeaking(false);
if (!hasMuted) {
console.log('muting assistant');
vapiInstance.send({
type: 'control',
control: 'mute-assistant'
})
hasMuted = true;
}
});
Hope my intent is a bit more clear nowKings_big💫
05/31/2025, 3:32 PMcertified dirtiboi
05/31/2025, 4:11 PMKyle Brunker
06/02/2025, 11:11 AMcertified dirtiboi
06/02/2025, 5:47 PMlet speakerCount = 0;
vapiInstance.on('speech-start', () => {
console.log('speech-start');
setIsSpeaking(true);
if (speakerCount > 0) {
console.log('ending call');
vapiRef.current.stop();
}
});
vapiInstance.on('speech-end', () => {
console.log('speech-end');
setIsSpeaking(false);
speakerCount++;
});
call ids for this approach:
- 21448df5-2a15-4ac2-9961-529924be0fc5
- 5ff48c89-5211-43d7-afaa-8f74feab5901certified dirtiboi
06/03/2025, 3:36 PMKings_big💫
06/03/2025, 5:15 PMcertified dirtiboi
06/03/2025, 8:41 PMKings_big💫
06/04/2025, 8:28 AMcertified dirtiboi
06/04/2025, 2:56 PMKings_big💫
06/04/2025, 10:21 PMcertified dirtiboi
06/06/2025, 6:28 PMlet speakerCount = 0;
vapiInstance.on('speech-start', () => {
console.log('speech-start');
setIsSpeaking(true);
if (speakerCount > 0) {
console.log('ending call');
vapiRef.current.stop();
}
});
vapiInstance.on('speech-end', () => {
console.log('speech-end');
setIsSpeaking(false);
speakerCount++;
});
Appreciate the help, @Kings_big💫Kyle Brunker
06/08/2025, 6:11 AM