Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private var myMic:Microphone;
- private var nc:NetConnection;
- private var ns:NetStream;
- // get connected
- private function get_connected():void {
- nc = new NetConnection();
- nc.connect("rtmp://your.domain.tld:1935");
- }
- // get audio source
- private function init_audio():void {
- myMic = Microphone.getMicrophone();
- }
- // start recording
- private function start_recording(fileName:String):void {
- ns = new NetStream(nc);
- ns.attachAudio(myMic);
- ns.publish(fileName, "record");
- }
- // stop recording
- private function stop recording():void {
- ns.play(false); // flushes the recording buffer
- ns.close();
- }
Add Comment
Please, Sign In to add comment