AudioAnalyser only works with autoplay
Hi Kevin!
I really like your current set of audioanalyser tools, but I can only seem to get the visualizers to work if autoplay is enabled on the src audio.
I've tried all sorts of workarounds, but if anything other than autoplay triggers the audio, the visualizers don't function.
If I comment out the line that connects the audioContext to the destination, the audio (correctly) is not audible when triggered. That leads me to believe the audio is in fact getting routed through the audioContext, even if the visualizers aren't working.
Any ideas?
I'm using the latest stable build (0.4.0) and mainly testing on Chrome.
So if you trigger the audio another way, you can still hear the audio, but analyser data isn't coming through? I am not sure, maybe we have to connect everything only once the audio starts playing?
That's probably it. Maybe I can rig a component to do that... I'll give it a shot!
Doesn't have to be a separate component, but let me know if that's the issue, and we can update the component to handle both autoplay/non-autoplay.
I tried hastily throwing together some setTimeout functions, but I don't think AFrame (or anybody else, really) likes that.
I'll take a look at this again soon.