How do you toggle a microphone directly between enhanced and non-enhanced?
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!
