var audio = document.createElement('audio'); socket.on('voice', function(arrayBuffer) { var blob = new Blob([arrayBuffer], { 'type' : 'audio/wav' }); audio.src = window.URL.createObjectURL(blob); audio.play(); });