I looked at some other speeches and tried but it doesn’t work. In my scene
this.music = new BABYLON.Sound("ses", env.STATICS_SERVER + "/assets/yildiz4.mp3", this.scene, () => {
console.log("Sound loaded!");
this.music.setPosition(new BABYLON.Vector3(0, 0, 0));
this.music.maxDistance = 1000;
this.music.play();
}, {
loop: true
});
I use it like this. But isPlaying is never true and I can’t get any sound. The version I use is 7.22.5.
this.music = new BABYLON.Sound("ses", env.STATICS_SERVER + "/assets/yildiz4.wav", this.sahne, () => {
console.log("Ses yüklendi!");
BABYLON.Engine.audioEngine.useCustomUnlockedButton = true;
BABYLON.Engine.audioEngine.WarnedWebAudioUnsupported = true;
BABYLON.Engine.audioEngine.unlock();
BABYLON.Engine.audioEngine.setGlobalVolume(1);
this.music.setDirectionalCone(90, 180, 0);
this.music.maxDistance = 1000;
this.music.play();
}, {
loop: true,
streaming: true
});