remove audio preload

This commit is contained in:
jorsi
2020-10-12 21:59:16 -04:00
parent af34686c71
commit 817decef2e
+9 -3
View File
@@ -12,15 +12,21 @@ var AudioEngine = {
_initialized: false,
init: function () {
AudioEngine._initAudioContext();
// AudioEngine._preloadAudio(); // removed to save bandwidth
AudioEngine._initialized = true;
},
_preloadAudio: function () {
// start loading music and events early
// ** could be used later if we specify a better set of
// audio files to preload -- i.e. we probably don't need to load
// the later villages or events audio, and esp. not the ending
for (var key in AudioLibrary) {
if (
if (
key.toString().indexOf('MUSIC_') > -1 ||
key.toString().indexOf('EVENT_') > -1) {
AudioEngine.loadAudioFile(AudioLibrary[key]);
AudioEngine.loadAudioFile(AudioLibrary[key]);
}
}
AudioEngine._initialized = true;
},
_initAudioContext: function () {
AudioEngine._audioContext = new (window.AudioContext || window.webkitAudioContext);