function startMic() {
  if (assistantConfig['respondToHotword']) {
    // Disable hotword detection when assistant is listening
    hotwordDetector?.stop();
  }

  if (canAccessMicrophone) {
    if (!mic) mic = new Microphone();
  }
  else {
    audPlayer.playPingStop();
    stopMic();
    displayQuickMessage('Microphone is not accessible', true);
    return;
  }

  if (config.conversation['textQuery'] !== undefined) {
    delete config.conversation['textQuery'];
  }

  // Prevent triggering microphone when assistant
  // has not been initialized.
  if (!isAssistantReady) return;

  mic.start();
  assistant.start(config.conversation);
}
Start the microphone for transcription and visualization.