async requestMicPermission()

in ChatbotUI/src/app/components/main/main.component.ts [204:216]


  async requestMicPermission() {
    this.permissionRequested = true; // Set flag to indicate request was made
    try {
      this.stream = await navigator.mediaDevices.getUserMedia({ audio: true });
      this.hasPermission = true;
      this.permissionRequested = false; // Reset flag
      // Now you can use the microphone stream (this.stream)
      console.log('Microphone stream granted:', this.stream);
    } catch (error) {
      this.hasPermission = false;
      console.error('Error getting microphone permission:', error);
    }
  }