1 decade ago by tarrent
Hi, I'd like to clarify if sound files are still preloaded even if I've specified
just before ig.main().
Impact's SoundManager works fine with desktop and android browsers but not yet so in mobile Safari, so I play ios sounds using a single audio sprite sheet from an external script for ios. I'd like to retain Impact's sound handler for desktop and android, but I'd like to know if these sound files are also preloaded (and thus, still downloaded again) on safari. If it does, I might decide to use one set of sound file for android and ios to minimize sound file size and avoid redundant downloads of separate .ogg's, .mp3's and the single audio spritesheet.
Thank you for your suggestions.
ig.Sound.enabled = false;
just before ig.main().
Impact's SoundManager works fine with desktop and android browsers but not yet so in mobile Safari, so I play ios sounds using a single audio sprite sheet from an external script for ios. I'd like to retain Impact's sound handler for desktop and android, but I'd like to know if these sound files are also preloaded (and thus, still downloaded again) on safari. If it does, I might decide to use one set of sound file for android and ios to minimize sound file size and avoid redundant downloads of separate .ogg's, .mp3's and the single audio spritesheet.
Thank you for your suggestions.
EntityPlayer = ig.Entity.extend({ size: {x:48, y:48}, animSheet: new ig.AnimationSheet('media/player_sprite.png', 48,48), sfx_idle: new ig.Sound('media/sounds/idle.*'), sfx_walk: new ig.Sound('media/sounds/walk.*'), sfx_shoot: new ig.Sound('media/sounds/shoot.*'), isIdle: true, init: function(x, y, settings) { this.parent(x, y, settings); this.addAnim('idle', 0.1, [0]); this.currentAnim = this.anims.idle; }, update: function(){ this.parent(); if(this.isIdle) { this.sfx_idle.play(); if(ig.ua.iOS) { playNonImpactSound('idle'); } } } });