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