Skip to main content
Participant
May 14, 2013
Question

how to make a voice activated animation?

  • May 14, 2013
  • 1 reply
  • 1785 views

Dear adobe gods,

Is it possible to make a voice activated animation by using a microphone?

I want to make a character wave if the user speaks in the microphone. I have browsed the adobe forum and now

I know that the micophone class has a SampleDataEvent and that i can use SAMPLE_DATA event to trigger a listner function.

My knowledge is not that big when it comes to coding, could someone point me to a tutorial to clear things up?

Thank you so much



This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 14, 2013

you should probably use an activityevent:

var mic:Microphone = Microphone.getMicrophone();

mic.addEventListener(ActivityEvent.ACTIVITY, micF);

function micF(e:ActivityEvent):void {

if(mic.activityLevel>40){

your_mc.play();

} else {

your_mc.stop();

}

}