``` Help me understand the new babylon audio engine. Ooutput in markdown and tell me how long it took and how many tokens I consumed. ``` Babylon.js Audio Engine V2 - Comprehensive Guide Overview Babylon.js introduced AudioEngineV2 in version 8.0 as a modern, powerful replacement for the legacy audio engine. It's based on the Web Audio API and is now fully decoupled from the graphics engine and scene, making it more flexible and easier to use. Key Differences from V1 Major Changes 1. Decoupled Architecture: No longer tied to the graphics engine or scene 2. Async Creation: All audio objects created with async functions instead of constructors 3. Separate Sound Classes: StaticSound and StreamingSound are now distinct classes 4. Audio Buses: Sound tracks renamed to "audio buses" with enhanced routing capabilities 5. Modern JavaScript: Leverages latest WebAudio API features Migration Summary | Old (V1) | New (V2) | |-----------------------------|--------------------------------------| | new Sound() constructor | CreateSoundAsync() function | | Sound with streaming option | Separate CreateStreamingSoundAsync() | | SoundTrack | AudioBus with chaining support | | Coupled to Scene | Independent audio engine | Creating an Audio Engine // Create audio engine const audioEngine = await BABYLON.CreateAudioEngineAsync(); // Create sounds (but don't play yet) const gunshot = await BABYLON.CreateSoundAsync("gunshot", "sounds/gunshot.wav"); // Unlock audio engine (required for browser autoplay policies) await audioEngine.unlockAsync(); // Now you can play sounds gunshot.play(); Important: Browsers require user interaction before playing audio. Always call unlockAsync() after user interaction and before playing sounds. Sound Types Static Sounds (Buffered) Best for: Short sound effects, UI sounds, repeated playback const gunshot = await BABYLON.CreateSoundAsync("gunshot", "sounds/gunshot.wav"); await audioEngine.unlockAsync(); gunshot.play(); Characteristics: - Entire sound loaded into memory - Low latency playback - Full playback control (looping, pitch, playback rate) - Can play multiple instances simultaneously Streaming Sounds Best for: Background music, long narrations, large audio files const music = await BABYLON.CreateStreamingSoundAsync( "music", "https://example.com/music.mp3" ); await audioEngine.unlockAsync(); music.play(); Characteristics: - Only small chunks kept in memory - Memory efficient for long files - Limited playback options (no loopStart/loopEnd) - Potential initial buffering delay - Uses HTML5