I have a button when i click on the button the sound is playing.
But the issue is in my local environment it is playing but in produciton it is showing this kind of issue.
babylon.js?v=4:1 Error while trying to play audio: engineSound, Cannot read properties of null (reading 'duration')
engineSound = new BABYLON.Sound(
"engineSound",
config.engineSound,
scene,
null,
{ loop: true, autoplay: false }
);
function playStopModelSound(action) {
if (action === "soundReset") {
if (engineSound.isPlaying || engineSound.isPaused) {
isEngineSoundPlay = false;
engineSound.stop();
}
return;
}
if (engineSound.isPlaying) {
engineSound.pause();
} else {
engineSound.play();
}
}
And in debugger I’m also getting stopped status for it