Skip to main content
jadestarh65085165
Participating Frequently
October 6, 2016
Question

The problem of Microphone.getEnhancedMicrophone() in AIR SDK 23

  • October 6, 2016
  • 11 replies
  • 3378 views

I am developing an android and iOS chatting app using air SDK 23.0 in flash builder 4.7.

The chatting server is Red5 0.6.

The mobile source code is following.

var devMic:Microphone = Microphone.getEnhancedMicrophone(); 

devMic.setUseEchoSuppression(true);

devMic.setLoopBack(false); 

devMic.gain = 80; 

devMic.rate = 11;

devMic.codec = SoundCodec.NELLYMOSER; 

devMic.addEventListener(StatusEvent.STATUS, onMicStatus); 

... ... ...

outStream = new NetStream(this);

if (useMic)

    outStream.attachAudio(devMic); // the phone speaker volume is lower and is impossible to hear.

outStream.publish(chatInfo.user_id, "live");

I use Microphone.getEnhancedMicrophone() function,

In this case, the microphone volume of my android is normal and the other side hears normally.

But the phone's speaker sound is so low I can not hear each other's words.

The above problem does not occur with the iPhone.

Before AIR SDK 23 released, I used Microphone.getMicrophone() with AIR SDK 22.0, The above problem does not occur with the android but has the echo problem.

What is the cause of this problem?

Please help me...

This topic has been closed for replies.

11 replies

Inspiring
March 2, 2017

As an update, still not able to get this working on Android, and I have now tested on Android v6 on Intel (x86) chip and when I use getMicrophone() (no echo suppress) mic works fine, but if I use getEnhancedMicrophone() no mic access (ie. mic doesn't work at all).

Any help appreciated, thanks.

morgenshtern
Participating Frequently
September 11, 2018

The issue is still exists in AIR 30.0.0.107 sdk

Workaround with:

SoundMixer.audioPlaybackMode = AudioPlaybackMode.VOICE;

SoundMixer.useSpeakerphoneForVoice = true;

didn't work - big speaker turns on for a second - then sounds switches to back to voice speaker.

We have to use general microphone, without AEC. It's extremely inconvenient for our users, they have to chat with headphones.

Please fix it!

Inspiring
February 19, 2017

Has anyone been able to get echo suppression working on Android? If so, which air sdk version, which mic settings and soundmixer settings?

Any help appreciated, thanks.

Inspiring
February 1, 2017

Hi,

Can anyone confirm that on Android, using AIR sdk 23/swf 34 or Air 24/swf 35 and the following settings/code, that echo suppression works?

"MODIFY_AUDIO_SETTINGS" in manifest

function getmic():void

{

mic = Microphone.getEnhancedMicrophone();

mic.gain = 80;

mic.rate = 22;

mic.codec = SoundCodec.SPEEX;

}

...

function starttalk():void

{

     SoundMixer.audioPlaybackMode = AudioPlaybackMode.VOICE;

     SoundMixer.useSpeakerphoneForVoice = true;

     getmic();

}

Still trying to get this to work - thanks.

Inspiring
January 26, 2017

Hi,

Can anyone confirm that on Android, using AIR sdk 23/swf 34 and the following settings/code, that echo suppression works?

"MODIFY_AUDIO_SETTINGS" in manifest

mic = Microphone.getEnhancedMicrophone();

mic.gain = 80;

mic.rate = 22;

mic.codec = SoundCodec.SPEEX;

SoundMixer.audioPlaybackMode = AudioPlaybackMode.VOICE;

SoundMixer.useSpeakerphoneForVoice = true;

Still trying to get this to work - thanks.

Inspiring
January 24, 2017

Hi,

HTC Android v4.1

Galaxy Note Android v5

Galaxy s7 Android v6

Can you let me know the settings you are using on Android to get the echo suppression to work?

Thanks.

Inspiring
January 22, 2017

Further to my post above, I have confirmed the generated swf version is 34, and I have tried to change the mic.gain to 50,60,70,80 and still get echo on the Android devices.

I have been able to get this working on iOS on devices iPhone 5 and higher (it does not work on iPhone 4s in our testing - voce is garbled with long, long delay) with slightly different values (which I also tried on the Androids and didn't work).

iOS settings:

    mic.noiseSuppressionLevel = -30;

    mic.codec = "speex";

    mic.encodeQuality = 5;

    mic.framesPerPacket = 1;

    mic.setUseEchoSuppression(true);

    mic.rate = 22;

    mic.gain = 60;

    mic.setSilenceLevel(0,200);

Any help appreciated, thanks.

deesharm
Adobe Employee
Adobe Employee
January 24, 2017

Hi Spider22,

Could you please list out the Android devices that you are using for testing your application?

The performance of this feature will be varying depending upon the OS version and the device type.

Thanks,

Adobe AIR Team

Inspiring
January 19, 2017

Hi, I am not sure if this issue was resolved, but I am experiencing the same issue:

Android 4/5/6, Air 23 SDK

"MODIFY_AUDIO_SETTINGS" in manifest

mic = Microphone.getEnhancedMicrophone();

mic.gain = 80;

mic.rate = 22;

mic.codec = SoundCodec.SPEEX;

SoundMixer.audioPlaybackMode = AudioPlaybackMode.VOICE;

SoundMixer.useSpeakerphoneForVoice = true;

And I still get echo.

Thanks.

jadestarh65085165
Participating Frequently
October 7, 2016

The running environment of this project is not simple.

So I am preparing the environment of testing for you.

Thanks.

deesharm
Adobe Employee
Adobe Employee
October 21, 2016

Hi Jadestar,

We have investigated it further and found that if we use SoundMixer.useSpeakerphoneForVoice = true; in our actionscript code the application seems to be working fine.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundMixer.html

Kindly test it at your end and let us know about the results.

Thanks,

Adobe AIR Team

jadestarh65085165
Participating Frequently
October 6, 2016

I shared source code in dropbox

The link is following as:

Dropbox - PrisonerChat-test.rar

deesharm
Adobe Employee
Adobe Employee
October 7, 2016

Hi Jadestar,

Could you please help me by giving some guidelines to use the project that you shared.

I have successfully imported the project in Flash Builder. But when I started debugging, I got stream error with the URL mentioned in config.as. I changed the URL with my local server address but I got no success so far.

Could you please provide us some steps that is required to use the project for establishing a successful connection between iOS and Android device.

Thanks,

Adobe AIR Team

jadestarh65085165
Participating Frequently
October 6, 2016

Thank you for your answer.

I  have already set  MODIFY_AUDIO_SETTINGS in my app.xml.

This is as follow:

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>

and I have already set as you send the method. But the problem is equal.

How do I share my project for you? Please give me a way to share.

Thanks.

deesharm
Adobe Employee
Adobe Employee
October 6, 2016

Hi Jadestar,

Please share it through Dropbox.

We will investigate it further.

Thanks,

Adobe AIR Team