Browse Source

Sound IsReady Function

Check If Sound Is Ready (Use full to check before calling sound.play
AND for sounds that are serialized and have NO CHANCE to assign
‘ReadySoundCallback’ in constructor from being parsed from scene file)
MackeyK24 8 năm trước cách đây
mục cha
commit
f0903ab080
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      src/Audio/babylon.sound.ts

+ 4 - 0
src/Audio/babylon.sound.ts

@@ -227,6 +227,10 @@ module BABYLON {
             }
             }
         }
         }
 
 
+        public isReady(): boolean {
+            return this._isReadyToPlay;
+        }
+
         private _soundLoaded(audioData: ArrayBuffer) {
         private _soundLoaded(audioData: ArrayBuffer) {
             this._isLoaded = true;
             this._isLoaded = true;
             Engine.audioEngine.audioContext.decodeAudioData(audioData, (buffer) => {
             Engine.audioEngine.audioContext.decodeAudioData(audioData, (buffer) => {