Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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();
}
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now