Flash Call Microphone

Source: Internet
Author: User

Import flash.events.ActivityEvent;
Import Flash.media.Microphone;
var devicearray:array = microphone.names;
Name of all available sound capture devices
var mic:microphone = Microphone.getmicrophone ();
Gets the index value of the current microphone
Mic.gain = 60;
Microphone gain-that is, the microphone should amplify the signal in multiples of the signal before transmitting it
Mic.rate = 11;
The frequency at which the microphone captures sound, in units of kHz
Mic.setuseechosuppression (TRUE);
Specifies whether to use the Echo suppression feature of the audio codec
Mic.setloopback (TRUE);
Set the microphone to loopback mode or turn it off
Mic.setsilencelevel (20, 300);
Set the minimum volume input level that can be considered audible, and the length of silence to be experienced before actually muting
Mic.addeventlistener (activityevent.activity, this.onmicactivity);
function Onmicactivity (event:activityevent): void
{
Trace ("activity =" + event.activating + ", activity =" + Mic.activitylevel);
}

if (mic.activitylevel>30) {
Your code
} ********************************************** to prevent echo effects: M.setuseechosuppression (FALSE); Make the Flash program connect to the microphone input signal m = Microphone.get (); Connect audio to the _root so that each object can communicate with ' m '
Attachaudio (m); Preventing the effects of echoes
M.setuseechosuppression (FALSE); Using a sound to control the size of the graph we set, Activitylevel returns a value between 0-100 by the input of the sound.
Onenterframe = function () {
Circle._xscale = Circle._yscale = m.activitylevel+50;
};

Flash Call Microphone

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.