Jump to content

Android won't play MP3


Recommended Posts

I just ran into another issue with Phaser and I'd like to know if it's a known bug – and of course if there is a solution!

I am trying to play sounds (mp3) with no success. The sound plays fine on my computer using Windows browser but the same code won't produce any sound on Opera Mobile Emulator or on my actual mobile (Samsung J2). I didn't try 'ogg' format because I searched online and found other people with the same problem and that have actually tried with no success.

After several frustrated tests with my own code I tried the following Phaser examples:



Guess what... same issue: works on computer but not on Opera Emulator neither my mobile.

Since I am writing this code specifically for mobiles this is a MUST for me that sounds play on them. Any clue? Below my code...

var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, 'test', { preload: preload, create: create });

var aExtensions = [

var aExtensions = ['.png','.mp3'];
var aTypes = ['img','snd'];
var aAssets = ['door','knock'];

function preload() {

function create() {
    var gamegroup = game.add.group();
    gamegroup.inputEnableChildren = true;

    window[aAssets[0]] = gamegroup.create(0,0, aAssets[0]);
    window[aAssets[1]+'snd']= game.add.audio(aAssets[1]);
    window[aAssets[0]].inputEnabled = true;

    window['lst'+aAssets[0]] = function (me) {
	me.visible = false;
    window[aAssets[0]].events.onInputUp.add(window['lst'+aAssets[0]], this);


Link to comment
Share on other sites

Never mind... after a LOT of research and more tests I figured that it's a Chrome bug. It works perfectly on Opera. One whole day of work lost thanks to a stupid browser that doesn't work as it should.


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...