Open Duckwhale opened 2 years ago
Actually, looks like BJS can draw a widget by itself:
var myAnalyser = new BABYLON.Analyser(scene);
BABYLON.Engine.audioEngine.connectToAnalyser(myAnalyser);
myAnalyser.drawDebugCanvas();
This may not be the best, but for debugging purposes it's likely sufficient.
Confirmed that this is trivial:
However, it looks kinda bad (not a big problem). More importantly, it needs to be disabled also, so a separate API is required.
Also TBD: Can it be attached to just a single sound track, and can multiple analyzers be displayed simultaneously, so that each channel can be observed on its own?
Update: Yup, works as expected. See https://doc.babylonjs.com/divingDeeper/audio/playingSoundsMusic#using-the-analyser
So I guess it would make sense to have an API connectAnalyzer(trackID)
, and if the ID is omitted it just connects to the audio engine (visualizes all channels) instead of a given audio track.
Split off from #54 since it requires connecting an
AudioAnalyzer
widget, which is NYI.The widget library is a huge mess, and I want to refactor it before adding even more stuff if at all possible.