我一直在尝试将HTML5音频与网络音频集成。 我正在使用MediaElementAudioSourceNode来使用HTML5音频。 在一段时间后,我需要完全断开HTML5音频与连接的MediaElementAudioSourceNode的连接,并且可能需要与其他一些新的MediaElementAudioSourceNode连接,但是当我尝试这个时,我在Chrome中遇到了一些错误,但在其他浏览器中没有测试过!
I've been trying to integrate HTML5 Audio with Web Audio. I'm using MediaElementAudioSourceNode to use HTML5 Audio. After some point of time I need to disconnect the HTML5 Audio completely from the connected MediaElementAudioSourceNode and may be need to connect with some other new MediaElementAudioSourceNode but when I try this I'm getting some error in Chrome not tested in other browsers though!
最满意答案
无法断开MediaElementAudioSourceNode是规范中的错误。
您无法将HTML元素连接到另一个MediaElementAudioSourceNode是Chrome中的一个错误。
我认为解决方法是使用GainNode根据需要使节点静音。 还可以使用音频节点的扇出功能,根据需要将MediaElementAudioSourceNode的输出路由到图形的新部分。 (可能插入另一个增益节点以控制输出。)
我认为不是很好,但可行。
Not being able to disconnect a MediaElementAudioSourceNode is a bug in the spec.
That you can't connect the HTML element to another MediaElementAudioSourceNode is a bug in Chrome.
I think the workaround is to use a GainNode to silence the node as needed. Also use the fan-out capabilities of a audio node to route the output of the MediaElementAudioSourceNode to a new part of the graph as needed. (Possibly inserting another gain node to allow control of the output.)
Not great, but workable, I think.
更多推荐
发布评论