rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.88k stars 160 forks source link

decodedBuffer doesn't contain the audio effects #106

Closed Catsvilles closed 5 years ago

Catsvilles commented 5 years ago

So, I'm trying to apply audio effects to a file and get the output as an AudioBuffer and render it as .wav or use with other libraries. But unfortunately even after applying effects to a file and rendering the buffer all I can hear is the original file with no effects. Is it actually possible with Audio Api overall? I know about streaming possibility and capturing the audio with MediaRecorder. But I need it as a background process, possibly with OfflineAudioContext. So, what are my options here? Does AudioNode is the thing that contains all effects and current file? Is there a way to convert it to buffer/.wav? Thanks a lot! :)

rserota commented 5 years ago

The decodedBuffer does not include the effects. Effects are applied fresh each time you play() a wad. I'm pretty sure that what you want to do is possible, but I'm not sure what the easiest way to do it would be. Wad.js used to include recorder.js to provide this functionality, but recorder.js is no longer being maintained, so I removed the recording features from Wad.js. If you check out recorder.js, or one of it's more well-maintained forks, you might be able to hack something together.

Catsvilles commented 5 years ago

@rserota Hm, I already use recorder.js and its worker for converting AudioBuffer to .wav, just cannot imagine how could I achieve getting the audio buffer with effects before play(), maybe with OfflineAudioContext? Anyway, I will try again a few 1000 times, maybe eventually I will find a way. :) Thank you very much!