cc.audioEngine.playEffect performance issues on web platform

Hi, im working on a prototype to test cocos creator. I’have built a simple prefab with a sprite (square tile) and a cc.AudioClip.

Then I instantiate 10 tiles on screen and the tiles perform a jump action + play sound effect when touched.

It works great on laptop browser, OSX and iOS builds. However playing it on safari in my iphone4s and my ipad3, performance is not good.

The problem is: the first time I touch a tile, the sound does not work. When I touch another tile, then works great. I guess this is related on how the assets/components are loaded and the first time is not fast/good enough to play it.

This is a very simple prototype and sound does not work well. So I was wondering if Im doing something wrong, or this is a known issue.

here is my code:

greyTile prefab is a sprite with a script component called tileEvents.js

initGame.js

cc.Class({
    extends: cc.Component,
    properties: {
        greyTile:{
            default: null,
            type:cc.Prefab,
        }
    },

    initBoard: function(){
        var mynode;
        var myCanvas = cc.director.getScene();
        for (var x = 0; x <13; x++)
        { 
            mynode = cc.instantiate(this.greyTile);
            mynode.setAnchorPoint(0,0);
            myCanvas.addChild(mynode);
            mynode.setPosition((mynode.width*x),300);
        }
    },
});

tileEvents.js

cc.Class({
    extends: cc.Component,
    properties: {
      fxsound:{
          url: cc.AudioClip,
          default:null
      }
    },
    onLoad: function () {
        this.node.on(cc.Node.EventType.TOUCH_START, this.touchMe,this);
    },
    touchMe: function(touch)
    {
        cc.log ("event: ",event);
        cc.log ("touch: ",touch);
        var action = cc.jumpTo(0.55, 400, -200, 350, 1);
        cc.audioEngine.playEffect(this.fxsound, false);
        this.node.runAction(action);
    },
});

And this is how it look likes in screen

Any help would be very much appreciated.
Thanks!

1 Like

Hi @pandamicro any news on this?
Any advice/tip would be very much appreciated.

Performance of the current audio engine is bad in JSB (mobile devices, windows), i’m waiting for the new engine, hope it solves the issue.

The lack of official response, is also a response, I guess…
Thanks for the feedback. :slight_smile:

Any updates on audio performance? As you can imagine, (like most games) we need working audio for our game!!!

3 months later and still didnt get a proper response. That is very frustrating. I managed to finish the game, but I cant publish web version because of the sound issues. As far as I know, it has not been fixed in 1.3.2 and because of the new Electron libraries on 1.4 I’m unable to use any Creator higher than 1.3.2.
As I said, very frustrating.

:disappointed: