无法从已处置的MediaElementAudioSource断开传递的Audio元素(Can't able to disconnect passed Audio element from d

编程入门 行业动态 更新时间:2024-10-25 10:31:49
无法从已处置的MediaElementAudioSource断开传递的Audio元素(Can't able to disconnect passed Audio element from disposed MediaElementAudioSource)

我一直在尝试将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.

更多推荐

本文发布于:2023-07-29 20:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1319586.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:元素   Audio   MediaElementAudioSource   disconnect   disposed

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!