在 Webaudio API 中路由多种效果 [英] Routing multiple effects in the Webaudio API

查看:27
本文介绍了在 Webaudio API 中路由多种效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

this.source.connect(this.filter); // Filter set to eq value 200
this.source.connect(this.convolver);
this.source.connect(this.dry);
this.convolver.connect(this.wet); // Convolver is the actual convolver
this.filter.connect( context.destination );     
this.dry.connect(context.destination); // Dry is a gain (at 1)
this.wet.connect(context.destination); // Wet is a gain (at 1)

当我想添加过滤器时,事情变得完全混乱.您可以假设过滤器和一切都设置正确.单独测试它们工作正常.然而,就目前而言,除过滤器外,一切正常.同样,单独的过滤器工作正常,但我不知道如何正确路由它.

As soon as I wanted to add a filter things got utterly confusing. You can assume that the filters and everything are set up right. Individually tested they work fine. As it stands now however, everything works except the filter. Again, the filter alone works fine but I cant figure out how to route it properly.

我确实看过这里:http://www.w3.org/TR/网络音频/#ModularRouting虽然这个例子对于我这样的初学者来说有点过于复杂.

I did have a look here: http://www.w3.org/TR/webaudio/#ModularRouting Though the example is a bit too complex for a starter like me.

我如何将过滤器路由到其余部分,以及当想要为音频文件的相同干湿部分添加更多效果时我必须考虑什么?.

How exactly do I route the filter to the rest and what do I have to consider when wanting to add more effects to the same dry and wet part of the audio file?.

奖励:一个不错的中间"图表会很棒:).

Bonus: A nice "intermediate" graph would be awesome : ).

推荐答案

一般来说,大多数效果"风格的路由需要串联,而不是并联.按照您的路由方式,最终过滤后的信号会添加到未过滤的信号中(通过卷积器的干湿路由路由).它仍然会产生一些影响,但这可能不是您想要的;你可能想要这个:

In general, most "effects"-style routings need to be in series, not parallel. The way you have it routed, in the end the filtered signal is getting added to the unfiltered signal (routed through the convolver wet and dry routes). It will still have some effect, but that's probably not what you want; you probably want this:

this.source.connect(this.filter); // Filter set to eq value 200
this.filter.connect(this.convolver);
this.filter.connect(this.dry);
this.convolver.connect(this.wet); // Convolver is the actual convolver
this.dry.connect(context.destination); // Dry is a gain (at 1)
this.wet.connect(context.destination); // Wet is a gain (at 1)

现在,湿/干增益将在卷积和非卷积信号之间平衡,但两者都将被过滤.

Now, the wet/dry gains will balance between a convolved and unconvolved signal, but both will be filtered.

这篇关于在 Webaudio API 中路由多种效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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