daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private var myMic:Microphone;
  2. private var nc:NetConnection;
  3. private var ns:NetStream;
  4.  
  5. // get connected
  6. private function get_connected():void {
  7.     nc = new NetConnection();
  8.     nc.connect("rtmp://your.domain.tld:1935");
  9. }
  10.  
  11.  
  12. // get audio source
  13. private function init_audio():void {
  14.     myMic = Microphone.getMicrophone();
  15. }
  16.  
  17. // start recording
  18. private function start_recording(fileName:String):void {
  19.     ns = new NetStream(nc);
  20.     ns.attachAudio(myMic);
  21.     ns.publish(fileName, "record");
  22. }
  23.  
  24. // stop recording
  25. private function stop recording():void {
  26.     ns.play(false); // flushes the recording buffer
  27.     ns.close();
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top