Audio in Android APK and Native/Chrome Browsers

0 favourites
  • 7 posts
From the Asset Store
100+ Musical High Quality Sound Effects for your game!
  • Hi,

    I'm new to the forums but have been developing with construct 2 for a year or so now. I'm making this post because I've spent days searching around the web and old forum threads for an answer, to no avail. And short of tearing my hair out, I thought I'd seek some advice.

    Basically I've created an interactive radio drama for children using Construct 2 (I know it's not a game in the traditional sense, but I guess it shows the platform can be used for all sorts of stuff) which you can view at

    My point is, that the export of the HMTL 5 Website (uploaded to the above URL) works fine in browser on a PC / Laptop and also on iPad and other iOS devices (after I fixed the audio lagging with a pre-loader).

    However, the audio doesn't work at all on android, and the primary market for this product is to create an APK that children and parents can download to their devices. I've tried viewing the above URL in both chrome and native android browsers on several devices, no audio on each occassion. I then tried coding up an APK myself using eclipse and webview, same problem occured again.

    I've heard Phonegap / Cocoonjs can create APK's from Construct 2 exports, but the problem is there are so many audio files and images associated with the project that it goes well over the limit for the phonegap build platform, and the one time I tried cocoonjs it returned a mere black screen for me.

    If anyone can offer up any advice on this conundrum I'd be most greatful, as I said I'm posting as a last resort to save me tearing my hair out as I've been working on this problem for weeks and have a degree show this coming Wednesday at which the project is supposed to be on show.

    Thanks if you can! <img src="smileys/smiley1.gif" border="0" align="middle" /> P.s. Be nice to the new guy!

  • benatkinson1991

    Have you tried to export with appMobi? If you haven't this will help you.

  • You might need to go through the steps of building manually in Eclipse using phonegap. I don't believe there would be any restrictions then.

  • You might want to try re-importing the audio to your project and see if there was a problem with its conversion to a chrome appropriate format. If you're playing only one sound at a time, this is likely the problem.

    Otherwise, the problem is probably the mobile chrome browser itself, which is notorious for its lackluster HTML5 audio support. Its known to have all sorts of problems, such as not being able to play more than 1 or 2 audio tracks at a time, and simply not playing audio tracks that are too long or too short.

  • rabidsheep

    Isn't cocoonjs much faster then phone gap and appmobi?


    I understand sound loading a bit slow but the black screen is unusual. Did you test your apk on the cocoonjs app? If so then that won't work.

    Refer back to this post and read my second response, I think it might help you:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Probably a redundant question, but are the audio files in the correct format? Android/Chrome only plays .ogg files

    Perhaps your program plays the sound with a call that isn't allowed on Android?

    Regarding wrapping and CocoonJS,I can recommend you try CocoonJS again. I had Black Screen the first time too. My problem was I had many unused assets in the project in Object Types. As soon as i removed them it ran immediately.

    Try cleaning up your code, look for unused assets, code that is simply wrong, checks and conditions that don't do anything, etc.

    CocoonJS states it only compiles the code for you and that it doesn't check for any coding errors. Even tho it compiles, it doesn't mean it's actually runnable on Android, so you have to do all the debugging yourself.

  • The memory usage could be high as well causing the black screen, would be able to tell us the memory use? You can see it on construct 2 at the bottom there's a value right beside "memory use".

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)