# Is there an onError event available when creating a sound?

**URL:** <https://forum.babylonjs.com/t/is-there-an-onerror-event-available-when-creating-a-sound/46016>\
**Category:** Questions\
**Tags:** sound\
**Created:** [November 29, 2023, 2:10am UTC](https://forum.babylonjs.com/t/is-there-an-onerror-event-available-when-creating-a-sound/46016 "2023-11-29T02:10:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musk](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/musk/32/17156_2.png) [@musk](https://forum.babylonjs.com/u/musk)\
**Post date:** [November 29, 2023, 2:10am UTC](https://forum.babylonjs.com/t/is-there-an-onerror-event-available-when-creating-a-sound/46016/1 "2023-11-29T02:10:39Z")

</div>

Hey~All,How do I properly handle the request result 404 when I create a sound?  
pg: [https://playground.babylonjs.com/#PCY1J#437](https://playground.babylonjs.com/#PCY1J#437)

---

<div class="post-metadata">

**Author:** ![lingliyi](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lingliyi/32/19427_2.png) [@lingliyi](https://forum.babylonjs.com/u/lingliyi)\
**Post date:** [November 29, 2023, 8:40am UTC](https://forum.babylonjs.com/t/is-there-an-onerror-event-available-when-creating-a-sound/46016/2 "2023-11-29T08:40:50Z")

</div>

If the error cannot be caught, I recommend checking the resource before creating the Sound class.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 29, 2023, 8:34pm UTC](https://forum.babylonjs.com/t/is-there-an-onerror-event-available-when-creating-a-sound/46016/3 "2023-11-29T20:34:55Z")

</div>

Adding @docEdub as he loves audio 🙂

---

<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:** [November 29, 2023, 9:25pm UTC](https://forum.babylonjs.com/t/is-there-an-onerror-event-available-when-creating-a-sound/46016/4 "2023-11-29T21:25:00Z")

</div>

You can fetch the sound into an `ArrayBuffer` and if it succeeds then pass the array buffer to the `Sound` constructor.

* * *

Here’s an example:

> **[Babylon.js Playground](https://playground.babylonjs.com/#PCY1J%23441)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

* * *
