简体   繁体   English

SoundJS中的混响

[英]Reverb in SoundJS

I know WebAudio supports reverb through a Convolver passthrough ( https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createConvolver ). 我知道WebAudio通过Convolver传递( https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createConvolver )支持混响。 Is there any way to apply reverb with SoundJS? 有什么方法可以在SoundJS上应用混响吗? I'm working on a game and would like to apply the same reverb to all sounds played through SoundJS. 我正在开发一个游戏,希望将相同的混响应用于通过SoundJS播放的所有声音。

The current version doesn't make this easy , but it is possible. 当前版本并不容易 ,但是有可能。

From our SoundJS dev: 从我们的SoundJS开发人员:

there's a couple of nodes that all audio fliters through, so you should be able to disconnect the dynamics compressor node (the last node before the output), hook it up to your convolver, and then hook that up to WebAudioPlugin.context.destination 所有音频都经过几个节点,因此您应该能够断开动态压缩器节点(输出之前的最后一个节点),将其连接到卷积器,然后将其连接到WebAudioPlugin.context.destination

You can see some raw node access in this demo: https://github.com/CreateJS/SoundJS/blob/master/examples/07_WebAudioNodeInsertion.html 您可以在此演示中看到一些原始节点访问: https : //github.com/CreateJS/SoundJS/blob/master/examples/07_WebAudioNodeInsertion.html

Here is some pseudo-code to get you started: 以下是一些伪代码,可以帮助您入门:

var waPlugin = createjs.Sound.activePlugin;
var context = waPlugin.context;
var yourNode = context.createConvolver();
// set up your convolver node here with your convolution buffer
waPlugin.dynamicsCompressorNode.disconnect();
waPlugin.dynamicsCompressorNode.connect(yourNode);
yourNode.connect(context.destination);

Hope that provides some insight. 希望能提供一些见识。

The intention of SoundJS was to make simple audio playback easy, given the poorly supported landscape years ago, but we want to do more to support WebAudio moving forward, so the big refactor that is in progress should make things like this more easy! 考虑到多年前支持不佳的情况,SoundJS的目的是使简单的音频播放变得容易,但是我们希望做更多的工作来支持WebAudio的发展,因此正在进行的大型重构应该使这种事情变得更加容易!

Cheers, 干杯,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM