Mute/Unmute Call
Control microphone input during a conversation by muting and unmuting the microphone while keeping the call active.
Mute Call
Temporarily mute the microphone to stop sending audio while keeping the conversation active:
import { Micdrop } from '@micdrop/client'
// Mute the microphone - stops recording but keeps call activeMicdrop.mute()
console.log('Call muted:', Micdrop.isMuted) // trueWhen muted:
- βΈοΈ Microphone stops recording
- βΈοΈ No audio is sent to the server
- β Voice activity detection stays enabled
- β WebSocket connection remains active
- β Assistant audio continues to play
- β Call processing continues normally
Unmute Call
Unmute the microphone to resume sending audio:
// Unmute the microphone - restarts recordingMicdrop.unmute()
console.log('Call muted:', Micdrop.isMuted) // falseconsole.log('Now listening:', Micdrop.isListening) // trueWhen unmuted:
- β Microphone starts recording again
State Monitoring
Monitor mute/unmute state changes:
Micdrop.on('StateChange', (state) => { if (state.isMuted) { console.log('π Microphone is muted') // Update UI to show muted state updateStatus('Muted - Click to unmute') } else if (state.isListening) { console.log('π€ Microphone unmuted - Listening...') // Update UI to show active state updateStatus('Listening for your voice') }})UI Integration
Create mute/unmute controls in your interface:
// Button handler for mute/unmute togglefunction toggleMute() { if (Micdrop.isMuted) { Micdrop.unmute() document.getElementById('muteBtn').textContent = 'Mute' } else { Micdrop.mute() document.getElementById('muteBtn').textContent = 'Unmute' }}React example:
import { useMicdropState } from '@micdrop/react'
function CallControls() { const state = useMicdropState()
return ( <button onClick={state.isMuted ? Micdrop.unmute : Micdrop.mute}> {state.isMuted ? 'π Unmute' : 'π Mute'} </button> )}Difference from Pause
Unlike pausing, muting only affects the microphone input:
| Feature | Mute | Pause |
|---|---|---|
| Microphone | β Disabled | β Disabled |
| Assistant Audio | β Continues | β Stopped |
| Processing | β Active | β Paused |
| Connection | β Active | β Active |
Use mute when you want to temporarily stop speaking but continue listening to the assistant. Use pause when you want to completely halt the conversation.