Copy link to clipboard
Copied
Apparently mixing calls between Microphone.getMicrophone() and Microphone.getEnhancedMicrophone() on the same device doesn't work very well. Take the following code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="onCreationComplete()" click="Microphone.getMicrophone().setLoopBack(true);">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
private function onCreationComplete():void
{
Microphone.getEnhancedMicrophone().setLoopBack(true);
}
]]>
</fx:Script>
</s:Application>
You will be able to hear yourself speak at first, but as soon as you click the app, you will no longer be able to hear your voice. I have also seen this sort of thing in other scenarios.
To make a long story short, if you call getEnhancedMicrophone() for one device, then try to call getMicrophone() for that same device, the device will stop providing any audio input. The same is true vice versa. However if you call getEnhancedMicrophone() for one device, then getMicrophone() for a different device, then come back to the first and call getMicrophone() for it, the device will work just fine.
Why? Is there any way to just toggle between enhanced and non-enhanced settings for the same device, without reaching out to an unrelated device? Thanks!
On your Microphone reference you have these constants you can set your options to:
As you can see there, MicrophoneEnhancedMode.OFF disables enhanced mode. You would set your Microphone references .mode property to equal that to disable enhanced, or use one of the other relevant options to enable it. Thus, you should always use enhanced so you can toggle it.
Copy link to clipboard
Copied
On your Microphone reference you have these constants you can set your options to:
As you can see there, MicrophoneEnhancedMode.OFF disables enhanced mode. You would set your Microphone references .mode property to equal that to disable enhanced, or use one of the other relevant options to enable it. Thus, you should always use enhanced so you can toggle it.
Copy link to clipboard
Copied
Wow, didn't think about that. Thanks!
Copy link to clipboard
Copied
You're welcome!