# \[Audio V2\] sound.onPlayObservable missing and audioEngine.unlockAsync demo missing

**URL:** https://forum.babylonjs.com/t/audio-v2-sound-onplayobservable-missing-and-audioengine-unlockasync-demo-missing/61769
**Category:** Questions
**Created:** [December 12, 2025, 1:57pm UTC](https://forum.babylonjs.com/t/audio-v2-sound-onplayobservable-missing-and-audioengine-unlockasync-demo-missing/61769 "2025-12-12T13:57:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)
#### Post date: [December 12, 2025, 1:57pm UTC](https://forum.babylonjs.com/t/audio-v2-sound-onplayobservable-missing-and-audioengine-unlockasync-demo-missing/61769/1 "2025-12-12T13:57:18Z")

</div>

Hi, @docEdub

I noticed that the audio engine is missing an observable like `onPlayObservable`, which could be useful to trigger something at the exact moment a sound starts. For example, in my case, I want to display a GUI window precisely when the Game Over sound plays, so they are perfectly synchronized.

Also, I noticed that in the PG demos in the documentation, `audioEngine.unlockAsync` hasn’t been updated to reflect this change. Previously, the demos used `audioEngine.unlock`, but now it has become `unlockAsync`. As a result, none of the PG demos in the documentation work anymore:

> **[Babylon.js docs](https://doc.babylonjs.com/features/introductionToFeatures/chap2/sound/)**

Thank you.

---

<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: [December 12, 2025, 2:44pm UTC](https://forum.babylonjs.com/t/audio-v2-sound-onplayobservable-missing-and-audioengine-unlockasync-demo-missing/61769/2 "2025-12-12T14:44:26Z")

</div>

Thanks, I’ll fix the docs but I’m not sure triggering GUI items on a sound’s state is a good idea since the audio engine may be locked and the observable may not get triggered as a result. I’d recommend triggering GUI items and they’re related sounds from your own code at the same time, instead.

---

<div class="post-metadata">

### Author: ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)
#### Post date: [December 12, 2025, 11:44pm UTC](https://forum.babylonjs.com/t/audio-v2-sound-onplayobservable-missing-and-audioengine-unlockasync-demo-missing/61769/3 "2025-12-12T23:44:59Z")

</div>

What I wanted to do was to display a Game Over text in a rectangle just as the sound would be triggered?

Because when I do as you say, there is a slight delay between the sound and the display of the Game Overs. Nothing too bad, I thought an onPlayObservable would do the trick.

I’m not talking about an observable at the time of play, but at the moment when the sound is triggered. But it doesn’t matter if it’s not recommended.

Thank you

---

<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: [December 15, 2025, 2:02pm UTC](https://forum.babylonjs.com/t/audio-v2-sound-onplayobservable-missing-and-audioengine-unlockasync-demo-missing/61769/4 "2025-12-15T14:02:49Z")

</div>

There shouldn’t be a delay with the sound’s `play` function. The sound should play immediately. Does the sound you’re using have a fade in or short silence at the beginning? …or maybe the sound is not being created beforehand? Creating a sound takes a little time, but there shouldn’t be any delay with `play` function itself.

---

<div class="post-metadata">

### Author: ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)
#### Post date: [December 15, 2025, 10:21pm UTC](https://forum.babylonjs.com/t/audio-v2-sound-onplayobservable-missing-and-audioengine-unlockasync-demo-missing/61769/5 "2025-12-15T22:21:11Z")

</div>

Ah yes, it is not generated beforehand. I do it on the fly. I should charge it beforehand indeed.  
Thank you.
