使用网络音频创建自定义回声节点 [英] Creating a custom echo node with web-audio

查看:17
本文介绍了使用网络音频创建自定义回声节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 webkit Audio API 并尝试创建一个回声效果,以实现我在循环中将 DelayNode 与 GainNode 连接起来(一个的输出是另一个的输入,反之亦然).

I'm playing with the webkit Audio API and I'm trying to create an Echo effect, to accomplish that I've connected a DelayNode with a GainNode in a loop (The output of one is the input of the other, and viceversa).

效果很好,但现在我想创建一个 EchoNode 对象,我可以插入它并与其他 AudioNode 对象连接.

The effect works fine, but now I want to create an EchoNode Object that I can just plug-in and connect with the other AudioNode objects.

类似于:

myEchoNode = new EchoNode(); 
myConvolverNode = context.createConvolver();
myConvolverNode.connect(myEchoNode);

我认为我应该让我的 EchoNode 从 AudioNode 继承,以便其他每个 AudioNode 的连接功能都可以工作,但我不知道如何使用 web Audio API 在 Javascript 中做到这一点.

I think that I should make my EchoNode inherit from AudioNode, so that the connect function of every other AudioNode would work, but I don't know how to do that in Javascript with the web Audio API.

谁能给我一个提示,或者如果您认为有更好的方法来完成,我将不胜感激.

Can anyone give me a hint, or if you think that there is a better way to accomplish that I would greatly appreciate it.

谢谢

推荐答案

看看我写的这篇文章,可能会给你一些启发:http://www.html5rocks.com/en/tutorials/casestudies/jamwithchrome-audio/(解释了 tuna.js 背后的基本思想道家推荐).

Have a look at this article I wrote, it might give you some ideas: http://www.html5rocks.com/en/tutorials/casestudies/jamwithchrome-audio/ (which explains the basic idea behind tuna.js that Taoist recommended).

这篇关于使用网络音频创建自定义回声节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆