Skip to main content
May 12, 2011
Answered

Problem accessing Android MIC

  • May 12, 2011
  • 5 replies
  • 1857 views

I have been reading the microphone class, and I cannot figure out why this code is not tracing anything out:

var mic:Microphone = Microphone.getMicrophone();

mic.gain = 100;

mic.rate = 44;

mic.setSilenceLevel(0, 6000);

mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);

private function micSampleDataHandler(event:SampleDataEvent):void{

     log("Recording");

}

according to the adobe help files this is alls that is needed to actually speak into the mic and have it know you are doing so.  But I cannot get the micSampleDataHandler to fire at all when whispering, talking, or screaming into the phone.

Am I missing something?

This topic has been closed for replies.
Correct answer Joe ... Ward

On Android, you must set the RECORD_AUDIO permission to access the mic.

5 replies

Joe ... WardCorrect answer
Participating Frequently
May 13, 2011

On Android, you must set the RECORD_AUDIO permission to access the mic.

May 12, 2011

and just to add to this:

I can trace out mic.muted and it returns false

and my phone is not on silent mode

so i can't figure out why its not receiving mic input, or rather why it is not firing off a sampledataevent

relaxatraja
Inspiring
May 13, 2011

Hope this screen shot helps:

Participant
August 26, 2012

On Samsung S Advance Android, I have set this permission but still Microphone not detecting any audio and SampleDataEvent.SAMPLE_DATA event never fired.....On IPhone its working perfectly but On Android its not. Kindly suggest how to overcome this terrible issue....