Introducing the Microphone : Microphone : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » Microphone »

 

Introducing the Microphone


 
package
{
    import flash.display.Sprite;
    import flash.events.*;
    import flash.media.Microphone;
    import flash.system.Security;
    public class Main extends Sprite
    {
        public function Main ()
        {

            var mic:Microphone = Microphone.getMicrophone();
            Security.showSettings("2");
            mic.setLoopBack(true);

            if (mic != null)
            {

                mic.setUseEchoSuppression(true);
                mic.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
                mic.addEventListener(StatusEvent.STATUS, statusHandler);
            }
        }

        private function activityHandler(event:ActivityEvent):void
        {
            trace("activityHandler: " + event);
        }

        private function statusHandler(event:StatusEvent):void
        {
            trace("statusHandler: " + event);
        }
    }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» Microphone