I cannot get microphone to work in MacOS. Can somebody give me a sample code of how to get the microphone, for a test build ( I dont have app certificate )
I am using Animate CC
import flash.media.*
import flash.events.*
import flash.events.PermissionEvent
import flash.permissions.PermissionStatus;
function ask(e) {
var _micPermissionManager = Microphone.permissionManager;
trace(_micPermissionManager.resourceType); //outputs microphone
trace(_micPermissionManager.permissionStatus); //outputs unknown
_micPermissionManager.requestPermission();
_micPermissionManager.addEventListener(PermissionEvent.PERMISSION_STATUS, onMicPermission);
}
function onMicPermission(e: PermissionEvent) {}
stage.addEventListener(MouseEvent.CLICK, ask)
and here is my app XML
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<application xmlns="http://ns.adobe.com/air/application/50.2">
<id>pm.flash.MacPermissions</id>
<versionNumber>1.0</versionNumber>
<filename>MacPermissions</filename>
<description></description>
<!-- To localize the description, use the following format for the description element.
<description>
<text xml:lang="en">English App description goes here</text>
<text xml:lang="fr">French App description goes here</text>
<text xml:lang="ja">Japanese App description goes here</text>
</description>
-->
<name>MacPermissions</name>
<!-- To localize the name, use the following format for the name element.
<name>
<text xml:lang="en">English App name goes here</text>
<text xml:lang="fr">French App name goes here</text>
<text xml:lang="ja">Japanese App name goes here</text>
</name>
-->
<copyright></copyright>
<initialWindow>
<content>MacPermissions.swf</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<fullScreen>false</fullScreen>
<autoOrients>false</autoOrients>
<aspectRatio>portrait</aspectRatio>
<renderMode>auto</renderMode>
<maximizable>true</maximizable>
<minimizable>true</minimizable>
<resizable>true</resizable>
</initialWindow>
<customUpdateUI>false</customUpdateUI>
<allowBrowserInvocation>false</allowBrowserInvocation>
<macOS>
<InfoAdditions><![CDATA[
<key>NSMicrophoneUsageDescription</key>
<string>Bob needs to access the mic for some reason</string>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
]]></InfoAdditions>
<Entitlements><![CDATA[
<key>com.apple.security.device.microphone</key>
<key>com.apple.security.device.audio-input</key> <true/>
<true/>
]]></Entitlements>
</macOS>
<icon></icon>
<version>1.0</version>
</application>