Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

389
Views
Angular web-app microphone switching causes error `NotReadableError: Concurrent mic process limit`

I am trying to implement a microphone switch feature where, whilst being on a live call on the browser, i am able to replace my current in-use microphone with a new one.

After selecting the new microphone I want to change to, I receive a NotReadableError: Concurrent mic process limit. error message. This error message is only replicable on firefox, on chromium browsers no error is shown however the issue of not being able to switch to another microphones persists anyway.

This is because the previous device isnt being deactivated/destroyed before adding the new device, this is visible from the permission icons here:

enter image description here

The old microphone is still active and thus when permitting the new device i receive the concurrent mic process limit error.

I am using replaceTrack() to swap to the new selected device, and the below function runs when selecting a new microphone to activate to.

async onMicrophoneSelected(event: any) {

// selectedDeviceId holds the deviceId of the microphone i want to switch to

        const selectedDeviceId = event?.value;

        var newAudioTrack;
        var constraints;
        var mediaStream: MediaStream;
        var audioTrack: MediaStreamTrack;

// Looping through all available devices here 

        await navigator.mediaDevices.enumerateDevices().then((res) => {
            res.forEach((device) => {

                // Here checking if the available device is an audioinput and if its id matches the one which we want to swap to.

                if (device.kind === 'audioinput' && device.deviceId === selectedDeviceId) {
                    newAudioTrack = device;

                    // constraints specified here with new deviceId of microphone

                    constraints = {
                        video: { facingMode: 'user' },
                        audio: { deviceId: { exact: newAudioTrack['deviceId'] } },
                    };

                }
            });
        });     

        // Passing constraints into mediaStream

        mediaStream = await navigator.mediaDevices.getUserMedia(constraints);
        audioTrack = mediaStream.getVideoTracks()[0];

        // Custom replaceTrack() function here 

        this.localUsersService
            .getWebcamPublisher()
            .replaceTrack(audioTrack)
            .then(() => {
                this.publishAudio(true);
                this.hasAudioDevices = true;
            });
    }

How can I completely deactivate the previous microphone / camera before switching to the new set of microphone and camera permissions ?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

As you already mentioned this is a limitation in Firefox which is currently being worked on.

https://bugzilla.mozilla.org/show_bug.cgi?id=1238038

You can stop the current stream before asking for another one by calling stop on all of its tracks.

mediaStream.getTracks().forEach((track) => track.stop());
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!