1mediaRecorder.ondataavailable = function(e) {
2 this.chunks.push(e.data);
3 if (this.chunks.length >= 700)
4 {
5 this.sendData(this.chunks);
6 this.chunks = [];
7 }
8};
9mediaRecorder.sendData = function(buffer) {
10 blob = new Blob(buffer, { 'type' : 'audio/wav' });
11 socket.emit('voice', blob);
12}