使用 WebAudio API 访问音频接口的所有输入通道?

Access all input channels of an audio interface using the WebAudio API?

我正在尝试访问连接的多输入音频接口的所有音频通道。我知道频道 应该 在使用 MediaStream 创建后由 MediaStreamAudioSourceNode 节点公开:

navigator.getUserMedia({ audio: true }, function(stream) {
    var input = audio.createMediaStreamSource(stream);
    console.log(input.channelCount);
});

问题是 input.channelCount 始终为 2,无论选择哪个设备作为用户媒体源。 Chrome 和 FireFox 也是如此。

媒体捕获和流规范指出:

A single MediaStreamTrack can represent multi-channel content, such as stereo or 5.1 audio or stereoscopic video, where the channels have a well defined relationship to each other. Information about channels might be exposed through other APIs, such as [WEBAUDIO], but this specification provides no direct access to channels.

(http://w3c.github.io/mediacapture-main/getusermedia.html#introduction)

这表明无法通过调用 getUserMedia 来影响频道数量(除非有一些我遗漏的特殊约束参数)。

MediaStreamAudioSourceNode 的 WebAudio 规范指出:

The first AudioMediaStreamTrack from the MediaStream will be used as a source of audio. [...] The number of channels of the output corresponds to the number of channels of the AudioMediaStreamTrack.

(http://webaudio.github.io/web-audio-api/#MediaStreamAudioSourceNode)

当我检查由 getUserMedia 创建的流时,它只有一个轨道。据我所知,不可能检查该轨道的通道数。所以看起来要么:

  1. getUserMedia 仅将前两个音频通道从连接的设备流式传输到单个 MediaStreamTrack。

  2. MediaStreamAudioSourceNode 忽略的不仅仅是在 MediaStreamTrack 中找到的前两个通道。

有人有关于这个问题的更多信息吗?我错过了什么吗?它还没有正确实施吗?我们怎样才能修复它?

Chrome 只是还不支持这个。已知问题。红蝉一直在看