Audio in Android APK and Native/Chrome Browsers

Get help using Construct 2

Post » Sat Jun 01, 2013 4:27 pm

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 http://charlieandthemoon.dreamingtigerproductions.com

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! P.s. Be nice to the new guy!
B
1
Posts: 1
Reputation: 127

Post » Sat Jun 01, 2013 6:36 pm

@benatkinson1991

Have you tried to export with appMobi? If you haven't this will help you.
B
16
S
5
G
4
Posts: 74
Reputation: 3,311

Post » Sat Jun 01, 2013 9:47 pm

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.
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,667

Post » Sun Jun 02, 2013 12:56 am

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.
B
21
S
8
G
5
Posts: 89
Reputation: 6,017

Post » Sun Jun 02, 2013 1:04 am

@rabidsheep

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

@benatkinson1991
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:
http://www.scirra.com/forum/topic68723_post422543.html#422543retrodude2013-06-02 01:06:07
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Sun Jun 02, 2013 1:27 am

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.Xionor2013-06-02 02:19:26
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Sun Jun 02, 2013 6:52 am

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".
B
18
S
4
G
3
Posts: 436
Reputation: 4,801


Return to How do I....?

Who is online

Users browsing this forum: Darknessed and 37 guests