I’m having some trouble getting all sounds attached to a scene. When calling scene.sounds, I get an empty array. When calling a single sound directly using scene.getSoundByName(), the expected <Sound> object is returned.
Am I using scene.sounds properly? Is there another (better) way to get all the sounds in a scene?
Hi/ you can get access to your sounds from scene.mainSoundTrack.soundCollection
since now you add sounds just to the stage, they fall into the main tracks array? what are you trying to do?
@kvasss: Your solution is what I’m looking for - thank you! (To answer your question, I’m trying to get all the sounds in a scene and dispose() them before loading another set of sounds. Please let me know if there is a smarter way to go about this).
@aFalcon: I’m just using the docs off of https://doc.babylonjs.com, but I don’t see any versioning to indicate that a property like scene.sounds isn’t available in the current version. Is there another set of docs I should be referencing instead?
Also, I’ve got a novice question about the playground search. When I search for “.sounds”, I get results that include “sound” (e.g. BABYLON.Sound()). Is there a way to do an exact search? (Tried quotes but no results were returned.)