mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-13 07:57:13 +08:00
remove audio preload
This commit is contained in:
+9
-3
@@ -12,15 +12,21 @@ var AudioEngine = {
|
|||||||
_initialized: false,
|
_initialized: false,
|
||||||
init: function () {
|
init: function () {
|
||||||
AudioEngine._initAudioContext();
|
AudioEngine._initAudioContext();
|
||||||
|
// AudioEngine._preloadAudio(); // removed to save bandwidth
|
||||||
|
AudioEngine._initialized = true;
|
||||||
|
},
|
||||||
|
_preloadAudio: function () {
|
||||||
// start loading music and events early
|
// 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) {
|
for (var key in AudioLibrary) {
|
||||||
if (
|
if (
|
||||||
key.toString().indexOf('MUSIC_') > -1 ||
|
key.toString().indexOf('MUSIC_') > -1 ||
|
||||||
key.toString().indexOf('EVENT_') > -1) {
|
key.toString().indexOf('EVENT_') > -1) {
|
||||||
AudioEngine.loadAudioFile(AudioLibrary[key]);
|
AudioEngine.loadAudioFile(AudioLibrary[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AudioEngine._initialized = true;
|
|
||||||
},
|
},
|
||||||
_initAudioContext: function () {
|
_initAudioContext: function () {
|
||||||
AudioEngine._audioContext = new (window.AudioContext || window.webkitAudioContext);
|
AudioEngine._audioContext = new (window.AudioContext || window.webkitAudioContext);
|
||||||
|
|||||||
Reference in New Issue
Block a user