# Are spatial sound instances possible?

**URL:** <https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330>\
**Category:** Questions\
**Created:** [February 3, 2026, 2:18pm UTC](https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330 "2026-02-03T14:18:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [February 3, 2026, 2:18pm UTC](https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330/1 "2026-02-03T14:18:34Z")

</div>

Hi everyone,

Please see this playground: [Babylon.js Playground](https://playground.babylonjs.com/#TTU1O4)

I am not too sure what’s going on there because, sometimes, I can hear more than 2 sounds. This is weird because otherwise I would have thought, since it is `sound.spatial.attach(mesh)`, you do need to load a sound per mesh.

Also, there is false positive and false negative playback. E.g. screenshot below. I am hearing 5 distinct pistol shots (expected 2 sounds).

 ![Screenshot 2026-02-03 150659](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/d/1d18a2bfffcd02fa234e5835ea37a9c560cf8372.jpeg)

If I create (CreateSoundAsync) a sound per cube, everything works as expected.

Just to make sure. My understanding is that maxDistance means that if Dist(camera,cube) \> max, sound not playing. Or maxDistance == radius of sound sphere (given cones=2Pi). Or given default values: volume 100% at minDistnace → volume 0% at maxDistance.

Best wishes  
Joe

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 3, 2026, 5:57pm UTC](https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330/2 "2026-02-03T17:57:16Z")

</div>

cc @docEdub

---

<div class="post-metadata">

**Author:** ![docEdub](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/docedub/32/14525_2.png) [@docEdub](https://forum.babylonjs.com/u/docEdub)\
**Post date:** [February 3, 2026, 6:48pm UTC](https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330/3 "2026-02-03T18:48:47Z")

</div>

Hmm, ok, it’s not super-clear to me what the problems you’re describing are.

Are you saying that you expect to hear 1 gunshot sound and 1 cannon sound after attaching them to several meshes? This is what I would expect, too. When attaching a sound to a mesh, it should detach from the previously attached mesh. It shouldn’t be attached to both meshes. I’ll look into it.

I’m not sure what you mean about false positive/negative playback. I do hear many gunshot sounds, though, which is unexpected. That may be related to the attach mesh issue.

`maxDistance` is where the sound will stop getting quieter, which is not always at silence. I don’t think there is an issue in the audio engine with this setting since it’s just passing the value straight to the WebAudio API. I’ll see what I can find out what’s going on in the playground with distance when I’m looking into the other issues.

For spatial distance settings details, the following may help:

- [PannerNode: distanceModel property - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel)
- [https://medium.com/@kfarr/understanding-web-audio-api-positional-audio-distance-models-for-webxr-e77998afcdff](https://medium.com/@kfarr/understanding-web-audio-api-positional-audio-distance-models-for-webxr-e77998afcdff)

---

<div class="post-metadata">

**Author:** ![docEdub](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/docedub/32/14525_2.png) [@docEdub](https://forum.babylonjs.com/u/docEdub)\
**Post date:** [February 3, 2026, 7:24pm UTC](https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330/4 "2026-02-03T19:24:34Z")

</div>

Ok, so the problems you’re hearing are being caused by calling the `play` function multiple times without calling `stop`. The `play` function does not stop previous instances of a sound being played, so you need to call `stop` before calling `play`.

See the [“Sound instances” section in the docs](https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic/#sound-instances) for more info.

---

<div class="post-metadata">

**Author:** ![docEdub](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/docedub/32/14525_2.png) [@docEdub](https://forum.babylonjs.com/u/docEdub)\
**Post date:** [February 3, 2026, 7:27pm UTC](https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330/5 "2026-02-03T19:27:30Z")

</div>

Here’s a playground that calls `stop` before calling `play`:  
[https://playground.babylonjs.com/#TTU1O4#3](https://playground.babylonjs.com/#TTU1O4#3)

---

<div class="post-metadata">

**Author:** ![docEdub](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/docedub/32/14525_2.png) [@docEdub](https://forum.babylonjs.com/u/docEdub)\
**Post date:** [February 4, 2026, 12:48pm UTC](https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330/6 "2026-02-04T12:48:06Z")

</div>

To answer the question in the subject line, all instances of a sound use the sound’s spatial settings. Think of it like the sound is the parent object and the instances are children. The instance children all move with the parent sound.

If you need them to move separately then separate sounds are needed, with separate spatial settings.

For multiple sounds using the same audio data, you can share the underlying sound buffer between sounds. See [Babylon.js docs](https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic/#sound-buffers) fo more info.

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [February 4, 2026, 7:17pm UTC](https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330/7 "2026-02-04T19:17:03Z")

</div>

Ahh, thanks you beat me to it.

* * *

Here was my understanding to clear things up:

_There is an audio source (createSoundAsync) and audio instances (source.play). Instances have their own state. Their starting state is taken from the source state at the time of playing._

_So, if we play a sound with 50% volume and then again with 75% volume, the same sound can play simultaneously with different volumes._

_To me it would have made sense that…_

_- audioSource.setVolume(0.5)_  
_- audioSource.spatial.attach(mesh1)_  
_- audioSource.play(loop=true)_

_and_

_- audioSource.setVolume(0.75)_  
_- audioSource.spatial.attach(mesh2)_  
_- audioSource.play(loop=true)_

_…would play the two sounds independetly and (if near enough) simultaneously. Apparently this is not the case as docEdub clarified above._

---

<div class="post-metadata">

**Author:** ![docEdub](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/docedub/32/14525_2.png) [@docEdub](https://forum.babylonjs.com/u/docEdub)\
**Post date:** [February 4, 2026, 8:04pm UTC](https://forum.babylonjs.com/t/are-spatial-sound-instances-possible/62330/8 "2026-02-04T20:04:11Z")

</div>

correct!
