dead-brownD
VAPI7mo ago
dead-brown

mute-assistant not working (web sdk)

Hello,

I'm trying to mute the assistant after the first message is said, but I'm unable to do so using the following

vapiInstance.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.
Was this page helpful?