Skip to main content
October 8, 2012
Question

Flash mobile development - AIR 3.4 and Microphone access

  • October 8, 2012
  • 2 replies
  • 1290 views

I'm encountering an issue with AIR 3.4 and the new Kindle Fire (2nd gen, non-HD).

There is no microphone, as Amazon's comparison chart illustrates: https://developer.amazon.com/sdk/fire/specifications.html, but AIR is telling me that there is a microphone.

It also reports a value of TRUE for Camera.isSupported and CameraUI.isSupported.

So here's the scoop on Kindle Fire:

  • 1st generation Kindle Fire does not properly support audio capture from within AIR (even with an external Microphone connected). For more information, see: https://bugbase.adobe.com/index.cfm?event=bug&id=3197063
  • 2nd generation Kindle Fire doesn't support audio capture unless an external microphone is connected. However, I don't know of a way within AIR to differentiate between headphone or no, because Microphone.isSupported always returns TRUE.
  • Kindle Fire HD supports audio capture with or without an external mic.

The best metric I know of to handle this, so far, is to use "android.os.Build.MODEL" to disable microphone use for the 1st gen Kindle.

This is kind of clunky though.

It also doesn't allow me to properly handle the 2nd gen Fire because there is no way (that I know of) to determine if the user has a microphone plugged in.

Anyone from Adobe care to weigh-in? (Or anyone that knows an alternative?)

Edit: Here's a test project that I've created that illustrates the problem:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" applicationComplete="init()"
              
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160">

   
<fx:Script>
        <![CDATA[
            private function init():void {
                cameraLabel.text = "Camera: " + Camera.isSupported.toString();
                cameraUILabel.text = "CameraUI: " + CameraUI.isSupported.toString();
                microphoneLabel.text = "Microphone: " + Microphone.isSupported.toString() + " => " + Microphone.getMicrophone();
            }
        ]]>
   
</fx:Script>

   
<s:VGroup horizontalCenter="0" verticalCenter="0">
       
<s:Label id="cameraLabel" />
       
<s:Label id="cameraUILabel" />
       
<s:Label id="microphoneLabel" />
   
</s:VGroup>

</s:Application>

Running this program on a 2nd gen Kindle Fire results in the following values being displayed on the screen:

Camera: true

CameraUI: true

Microphone: true => [object Microphone]

This topic has been closed for replies.

2 replies

Colin Holgate
Inspiring
October 15, 2012

You talked about using android.os.Build.MODEL, but how do you access that? I can't find any ANE that does that.

October 15, 2012

You can read this from the "/system/build.prop" file on Android.

Funky Monkey Studio has released a nice utiltiy class for doing this, NativeDeviceInfo.