babylon.audioengine.js 900 B

12345678910111213141516171819202122232425
  1. var BABYLON;
  2. (function (BABYLON) {
  3. // We're mainly based on the logic defined into the FreeCamera code
  4. var AudioEngine = (function () {
  5. function AudioEngine() {
  6. this.audioContext = null;
  7. this.canUseWebAudio = true;
  8. try {
  9. if (typeof AudioContext !== 'undefined') {
  10. this.audioContext = new AudioContext();
  11. } else if (typeof webkitAudioContext !== 'undefined') {
  12. this.audioContext = new webkitAudioContext();
  13. } else {
  14. this.canUseWebAudio = false;
  15. }
  16. } catch (e) {
  17. // Web
  18. this.canUseWebAudio = false;
  19. }
  20. }
  21. return AudioEngine;
  22. })();
  23. BABYLON.AudioEngine = AudioEngine;
  24. })(BABYLON || (BABYLON = {}));
  25. //# sourceMappingURL=babylon.audioengine.js.map