Hi,
I am actually playing my sound from URL with this function :
SoundController.prototype.playSound = function(audio) {
this.entity.sound.removeSlot('currentSound');
var soundAsset = new pc.Asset("soundName.ogg", "audio", { url: audio });
this.app.assets.add(soundAsset);
this.entity.sound.addSlot('currentSound', {
asset: soundAsset
});
this.entity.sound.play('currentSound');
};
It work fine but, sometime, sound isn’t loaded. So, I want to know if sound is loaded or not.
Is there any way to check this ? And if it’s not loaded restart the call to the server ?