javascript - Getting contents of a streaming Blob to be sent to a Node.js Server -


i have working page uses microphone stream data <audio> tag.

however, want data sent <audio> tag harvested instead. how think can data being streamed harvested , continuously streamed node.js server? (i gonna use binaryjs binary data streaming.)

this code have luckily. :)

<audio src="" id="audio" controls="controls">sad twinkletoes not have audio.</audio><br> <br> <span id="aw"></span> <script>  try {     navigator.getmedia = ( navigator.getusermedia    || navigator.webkitgetusermedia ||                         navigator.mozgetusermedia ||navigator.msgetusermedia);      navigator.getmedia ({             audio: true         },         function(stream) {             var audio = document.getelementbyid('audio');             var streamer = window.url.createobjecturl(stream);             audio.src = streamer;             var loopertime = 3;             var looper = setinterval(function() {                 if(loopertime == 0) {                     clearinterval(looper);                     audio.play();                     // stream starts here!                     var spanner = document.getelementbyid('aw');                     spanner.innerhtml = '<code>streaming...</code>';                     // want data streamed...                   } else {                     audio.play();                     settimeout(function() {                         audio.pause();                     },10);                     loopertime--; // played , paused 3 times... getaround audio not working                 }             },15);         },         function(err) {             // no permissions         }     ); }  catch(e) {     alert('your browser not support html5 audio media.');     console.log(e); }  </script> 

https://github.com/muaz-khan/webrtc-experiment/tree/master/rtcmulticonnection

thats way go. not saying have use specific library, webrtc how you're going want mess around streaming audio (or video) users local device else. you'd think it'd easy audio stream audio element turns out pretty tricky.

the above library has hooks node , socket.io, although uses firebase session initiation/handshake default.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -