Skip to main content
Inspiring
September 12, 2016
Answered

Release the microphone.

  • September 12, 2016
  • 2 replies
  • 548 views

It seems that after calling Microphone.getMicrophone(), the app "owns" the device microphone, so other apps report the microphone as used by another app. Is there a way to programmatically "release" the microphone without closing an Air app?

This topic has been closed for replies.
Correct answer deesharm

Hi Alex,

Yes, you can use Event.DEACTIVATE to make it work both on Android and iOS as Event.SUSPEND is dispatched only on AIR iOS.

Please refer to the below link to know more about AS3 Events:

Event - Adobe ActionScript® 3 (AS3 ) API Reference

Thanks,

Adobe AIR Team

2 replies

deesharm
Adobe Employee
Adobe Employee
September 14, 2016

Hi Alex,

You can use the events such as Event.SUSPEND and handle it in such a way that it sets the microphone object to null when application goes into the background.

I tried with a below piece of code for iOS:

NativeApplication.nativeApplication.addEventListener(Event.SUSPEND, killObject);

protected function killObject(e: Event): void {

  trace("Suspend Received");

  mic = null;

  }

And Application seems to be working fine. It sets my microphone object to null when I send my application to the background on iOS devices.

Thanks,

Adobe AIR Team

Inspiring
September 14, 2016

Thank you. Are there any disadvantages to using Event.DEACTIVATE instead of Event.SUSPEND? My app should work both on iOS and Android.

deesharm
Adobe Employee
deesharmCorrect answer
Adobe Employee
September 15, 2016

Hi Alex,

Yes, you can use Event.DEACTIVATE to make it work both on Android and iOS as Event.SUSPEND is dispatched only on AIR iOS.

Please refer to the below link to know more about AS3 Events:

Event - Adobe ActionScript® 3 (AS3 ) API Reference

Thanks,

Adobe AIR Team

Inspiring
September 13, 2016

Is anyone from Adobe checking this forum?