Hi guys, sorry to butt-in. https://www.babylonjs-playground.com/#EDVU95#15
Ok, ok, I faked it with line 31. Disable line 31 and activate line 25, to see that I solved nothing. But heck, we have a testing PG, now.
Update: https://www.babylonjs-playground.com/#EDVU95#18 Lots of testing debris in there, but it appears that line 49 is a solution (in 40 mins of experimenting - ahem - hug).
I might have found it faster… had I read the docs. Play Sounds and Music - Babylon.js Documentation (Wingy accidentally skips research steps, too.)
Perhaps we should add a few notes in that docs section… about parented cameras (with human ears), and about using useCustomAttenuation = true by itself (like PG #18), without adding music.setAttenuationFunction = someCustomAttenuationFunc().
Fun challenge for someCustomAttenuationFunc() programmers: Put TWO musical crates (as speaker cabinets for the DJ)… inside the nightclub. When the door to the nightclub opens, the music gets louder, based-upon how WIDELY the door is opened.
Then move camera/player around outside the nightclub’s open door, and use raycasting to determine WHEN the camera is within DIRECT sight/ear-shot of either speaker (shooting the ray thru the open door). When camera can “see” either speaker thru open door (cam-to-either-crate ray == direct-hit), the music gets even louder. FUN! Sound-reducing walls - 101. (audio ambient occlusion?)
Now where is that music.muffle(muffleValue) func? err… perhaps mesh.audioOpacity? Extra credit if each speaker cabinet… is a Leslie speaker (dual spinning sound projectors in each cab). OMG! heh