我正在寻找量化实时音频流并使用 WebSockets 将其发送到另一个客户端。
navigator.getUserMedia({audio: true}, function(localMediaStream) {
var audio = document.querySelector('audio');
audio.src = window.URL.createObjectURL(localMediaStream);
// Get OSC every 25ms from localMediaStram?
// Note: onloadedmetadata doesn't fire in Chrome when using it with getUserMedia.
// See crbug.com/110938.
audio.onloadedmetadata = function(e) {
// Ready to go. Do some stuff.
};
}, onError);