Reputation: 235
I know WebAudio supports reverb through a Convolver passthrough (https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createConvolver). Is there any way to apply reverb with SoundJS? I'm working on a game and would like to apply the same reverb to all sounds played through SoundJS.
Upvotes: 0
Views: 72
Reputation: 11294
The current version doesn't make this easy, but it is possible.
From our SoundJS dev:
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
You can see some raw node access in this demo: 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!
Cheers,
Upvotes: 1