Guest User

Untitled

a guest
Jul 11th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment