📜  从客户端播放音频流 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:57.683000             🧑  作者: Mango

代码示例1
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();
});