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);
}