Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Detecting microphone change

Avatar

Former Community Member

Hello,

I am using Adobe LCCS with the Flash 10.2 SWC.

We were having a problem that when a user changed the microphone (using right click -> settings -> microphone) it did not change the published audio stream. Nor did it even take the correct mic when it started (always took 0-indexed mic).

We did some reading and saw that it is recommended to select the microphone in the MicrophoneManager on init:

            if (Microphone.getMicrophone() != null) {

                MicrophoneManager.getInstance().micIndex = Microphone.getMicrophone().index;

            }

That solved the startup microphone selection, then we added this code to re-publish audio upon mic change (called on a certain interval):

            // Selected mic changed

            if (Microphone.getMicrophone() != null && (MicrophoneManager.getInstance().micIndex != Microphone.getMicrophone().index)) {

                MicrophoneManager.getInstance().micIndex = Microphone.getMicrophone().index;

                if (audioPublisher != null) {

                    audioPublisher.stop();

                    audioPublisher.publish();

                }

            }

My questions:

- Is there a better way to detect microphone change? (saw there is an 'activated' event, but it was not called)

- Does calling Microphone.getMicrophone() requires some OS resources and therefore it is not recommended to call it with a small interval

- Is the whole approach correct or there is a better way for LCCS to automatically manage the whole thing?

Thanks in advance,

ehud

2 Replies

Avatar

Level 2

Ehud,

Did you ever find answers to any of your questions?  I'm just starting to work with the LCCS platform, and I'm also wondering about the best way to manage microphones.

Thanks,

Mike

Avatar

Former Community Member

Hi Mike,

Yes, we found answers to our quesions and we are using LCCS with the new Acoustic Echo Cancellation feature.

Works ok for us at the current time.

Ehud