This forum is read only and just serves as an archive. If you have any questions, please post them on

1 decade ago by tarrent

Hi Everyone,

I've created a very simple, basic game, just to test OGG sounds for android. The game loads and sounds work when in desktop, but the loading bar stops when loaded on mobile.

Can you advice me what am I doing wrong?
P.S.: I've got both .mp3 and .ogg sound files available for the game.

The game can be accessed at:

And the Entity that plays the sound is written like this:

    EntitySquare = ig.Entity.extend({
        size: {x:48,y:48},
        animSheet: new ig.AnimationSheet('media/48x48.png', 48, 48),
        sfx_click: new ig.Sound('media/paytable.*'),
        sfx_bell: new ig.Sound('media/casino_bell.*'),
        sfx_cash: new ig.Sound('media/Cash.*'),
        soundOn: false,
        sprIndex: 0,
        init: function(x, y, settings){
            this.parent(x, y, settings);
            this.addAnim('idle', 0.1, [0]);
            this.currentAnim = this.anims.idle;
            if(settings.sprIndex != null){
                this.sprIndex = settings.sprIndex;
        update: function(){
            if(ig.input.pressed('leftclick') && this.inRange()){
                    case 0:; break;
                    case 1:; break;
                    case 2:; break;
                    default: break;
        inRange: function(){
            var valid = 0;
            var isInRange = false;
            if(ig.input.mouse.x >= this.pos.x && ig.input.mouse.x <= (this.pos.x+this.size.x))
            if(ig.input.mouse.y >= this.pos.y && ig.input.mouse.y <= (this.pos.y+this.size.y))
            if(valid == 2) isInRange = true;
            return isInRange;


1 decade ago by dominic

Unfortunately, sound is almost impossible to get working on mobile in a meaningful way. Mobile browser's simply refuse to pre-load sounds, no matter what.

The easiest solution is to disable sound completely on those devices. See this article.

1 decade ago by tarrent

Thanks dominic, I have already ready that article. I have disabled Impact laden sounds from my other iOS game, and used a single audio sprite sheet instead.

But what baffles me is, I have used the same sound assets and same coding logic of this demo on that other game (referring only to android), and the OGG sounds load perfectly there while it does not anymore on this simple demo O_o.

I'll be providing the link to that other game later.

Page 1 of 1
« first « previous next › last »