function stopMic() {
  if (assistantConfig['respondToHotword']) {
    // Enable hotword detection when assistant has done listening
    hotwordDetector?.start();
  }

  console.log('STOPPING MICROPHONE...');
  if (mic) mic.stop();
  p5jsMic.stop();

  if (initHeadline) {
    initHeadline.innerText = supportedLanguages[assistantConfig['language']].welcomeMessage;
  }

  // Set the `Assistant Mic` icon

  const assistantMicrophoneParent = document.querySelector('#assistant-mic-parent');

  assistantMicrophoneParent.outerHTML = `
    <div id="assistant-mic-parent" class="fade-scale">
        <img id="assistant-mic" src="../res/Google_mic.svg" type="icon" alt="Speak">
    </div>
  `;

  // Add Event Listener to the `Assistant Mic`

  assistantMicrophone = document.querySelector('#assistant-mic');
  assistantMicrophone.onclick = startMic;
}
Stops the microphone for transcription and visualization.