In V1 all sounds could be accessed through scene.sounds, but in V2 that object is null.
The audioEngine._nodes seems like containing the references, but it’s considered private. It also allows duplicates by name that don’t have any sort of unique id (as far as I can see).
Would you consider using a Set to track sounds instead of an Array? After this change, the cost of Sound.dispose()went from O(1) to O(n).
For my application, where I’m creating and disposing several sounds per frame, keepingSound.dispose()as O(1) would be a huge help.
To accommodate both performance and the new property, could we return a Set of sounds? Or if the returned property needs to be an Array, perhaps a ReadonlyArray could be generated from an internal Set?