mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
remove audio preload
This commit is contained in:
+9
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user