mymic
import flash.net.NetStream;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.media.Video;
/**
* Copyright BarudEtni ( http://wonderfl.net/user/BarudEtni )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/167Y
*/
package {
import flash.net.NetConnection;
import flash.net.NetStream;
// import flash.net.NetStream;
import flash.events.Event;
import flash.media.*;
import flash.display.Sprite;
// import flash.events.NetStatusEvent;
// import flash.events.SecurityErrorEvent;
// import flash.media.Video;
public class MicTest extends Sprite {
public function MicTest() {
var nc:NetConnection;
var mic:Microphone;
var ns:NetStream;
nc = new NetConnection();
nc.onStatus = function(info){
trace(info.code);
if(info.code.indexOf("Success") != -1) {
getMic();
}
}
function getMic(){
mic = Microphone.get();
ns = new NetStream(nc);
ns.attachAudio(mic);
ns.publish("mymic", "live");
}
nc.connect("rtmp:/libr8d.srfms.com/applications/serversidenetstreams/test1");
}
}
}