Is there an onError event available when creating a sound?

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

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

Adding @docEdub as he loves audio :slight_smile:

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:


2 Likes