Skip to main content
jadestarh65085165
Participating Frequently
Oct 6, 2016 3:35 AM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

17 replies

Inspiring
Mar 2, 2017 2:59 PM UTC

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.

Translate
morgenshtern
Participating Frequently
Sep 11, 2018 10:00 AM UTC

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!

Translate
Inspiring
Feb 19, 2017 4:52 PM UTC

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.

Translate
Inspiring
Feb 1, 2017 5:15 PM UTC

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.

Translate
Inspiring
Jan 26, 2017 4:17 PM UTC

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.

Translate
Inspiring
Jan 24, 2017 4:27 PM UTC

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.

Translate
Inspiring
Jan 22, 2017 4:21 PM UTC

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.

Translate
deesharm
Adobe Employee
Adobe Employee
Jan 24, 2017 8:55 AM UTC

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

Translate
Inspiring
Jan 19, 2017 11:44 PM UTC

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.

Translate
jadestarh65085165
Participating Frequently
Oct 7, 2016 7:12 AM UTC

The running environment of this project is not simple.

So I am preparing the environment of testing for you.

Thanks.

Translate
deesharm
Adobe Employee
Adobe Employee
Oct 21, 2016 11:50 AM UTC

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

Translate
jadestarh65085165
Participating Frequently
Oct 6, 2016 6:56 AM UTC

I shared source code in dropbox

The link is following as:

Dropbox - PrisonerChat-test.rar

Translate
deesharm
Adobe Employee
Adobe Employee
Oct 7, 2016 5:30 AM UTC

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

Translate
jadestarh65085165
Participating Frequently
Oct 6, 2016 6:30 AM UTC

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.

Translate
deesharm
Adobe Employee
Adobe Employee
Oct 6, 2016 6:34 AM UTC

Hi Jadestar,

Please share it through Dropbox.

We will investigate it further.

Thanks,

Adobe AIR Team

Translate