Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Audio Stream from Server through Scoket

mediaRecorder.ondataavailable = function(e) {
  this.chunks.push(e.data);
  if (this.chunks.length >= 700)
  {
      this.sendData(this.chunks);
      this.chunks = [];
  }
};
mediaRecorder.sendData = function(buffer) {
  blob = new Blob(buffer, { 'type' : 'audio/wav' });
  socket.emit('voice', blob);
}
 
PREVIOUS NEXT
Tagged: #Audio #Stream #Server #Scoket
ADD COMMENT
Topic
Name
8+6 =