No sound on Android
chemvishnu
Hi,
I am developing a game with Wade for use on Android platform. I am having trouble with the sound/audio to work when the app is deployed onto the phone. The audio seems to work fine on the Chrome browser emulator on the PC. But on the android phone there is no sound. I have tried using multiple audio file formats such as .ogg, .aac and .mp3 as suggested in the tutorials, but no luck. I really like the WADE engine but audio would be an important piece if I were to use it for mobile development. Please let me know if someone has figured out a solution. Thanks!
All 11 Comments
Gio

Hi and welcome to the forums :)

 

What do you mean exactly by Android platform?

 

We are using audio successfully on a variety of Android platforms (several combinations of operating system version + browser type). Obviously Chrome for Android is preferable, because it has the best audio support, but you can at least have some audio on most version of the stock Android browser. This may be limited by the particular browser's capabilities, for example it may be that it can only reproduce one sound at a time, but there should be some sound.

 

If you are planning to make an actual android app out of your game (an .apk), then you can use a Chromium wrapper and have full audio support

 

Anyway, if you can let me know what type of browser and Android version you are having problems with, I'll look into it.

 

Thanks

chemvishnu

Hi,

 

Thank you for the reply.

 

Yes, indeed. I am trying to make an actual android app out of the game (i.e., an .apk). I can look into the Chromium wrapper but if you could point me to resources or give me instructions on how to use the Chromium wrapper with games created with WADE engine, I would appreciate it. Thanks again!

Gio

I recommend using this tool: https://crosswalk-project.org/

 

It's a bit of a pain to set up, but once you have done it, you can create apk's in a couple of minutes. There are tutorials and detailed explanations on their website (though it's pretty simple really).

Gio

Oh I forgot to say... use .ogg for Android :)

chemvishnu

Thanks for the tip. I checked out cross-walk project tool. Looks promising. 

 

It installed OK along with other dependencies etc. However when I try to make the apk with the make_apk.py command it runs into problems. Here is the error:

 

   " from dex import AddExeExtensions
ImportError: cannot import name AddExeExtensions "
 
Strange as I installed the dex package for the python installation. Anyway, please let me know if I am missing something.
 
Thanks for all the help!
Gio

Yes, like I said it's a pain to set up :)

 

I haven't seen that error before, but it seems to suggest that the dex package isn't in a system path. It could be that you just need to close and reopen the command prompt window after installing the dex package. Assuming you're on Windows, this would force the environment variables to be updated for your command prompt.

 

I don't really know what that tool does internally, so I can't be of much help here. It may be better asking them if my suggestion above doesn't work. But having said that....

 

We have been working on a webservice to make this sort of things easier for WADE users. It isn't ready just yet, and it may be that we can't provide it for free as it's pretty bandwidth-intensive, but if you're interested in trying it before it launches (for free obviously) just let me know.

 

The way it works is as follows: you upload a zip containing your project to our server, our server creates the apk (with a Chromium wrapper) and sends it back to you. I think it's going to be in a "testable" state at some point next week.

chemvishnu
I tried restarting the terminal window (I am on Linux) but to no avail. The problem still persists. It could be a python version issue. Could you please let me know what version of Python are you using.

Actually the idea of the web service is excellent. I would be delighted to test it out whenever it is ready. So please sign me up as a beta/alpha tester. I was using PhoneGap Build to make my apks and that is exactly what it does. It is a web service for creating apks from uploaded zip files. Unfortunately it doesn't seem to work well when audio is involved. I was even considering paying them if it had worked. So would be more than happy to test out your free version :-)

Thanks!!
Gio

We are almost done with the webservice, a very rudimentary version of it should be available by the end of the week. I'll send you a private message with a link to try it. By the way, if anyone else wants to help us test it, just give me a shout.

 

I wanted to say that, while working on this a couple of days ago, I ran into the exact same problem that you described above. It turns out that you have to be in the crosswalk directory when executing the python script. So don't

python c:/crosswalk/make_apk.py

but rather go to c:/crosswalk first, then do:

python make_apk.py

otherwise it's unable to locate the python modules.

Shri

Gio,

 

Can you sign me up for the APK bulider test.

I would like to create an APK from my last released game PT Raid.

I also have a new game that should be ready in about a week that I would like to create an APK for.

 

cheers,

Shri

Gio

OK, so an ugly but hopefully functional alpha version of this apk builder is now live. I've sent you both instructions in a private message.

 

If anyone else would like to try it, feel free to let me know.

 

A couple of notes:

 

1) it may or may not work. If it doesn't, please give me as much info as possible and I'll fix it

2) you must upload a zip that contains the whole project (including all the images, sounds, etc. in their respective subfolders if any), with the top-level folder (the root of the zip) containing an index.html file

3) if you have a 128x128 icon.png file in the root it will be used as an icon for your app, otherwise a default one is used.

4) This is for testing only because it uses a default keystore. If you try to publish an apk generated through this service on Google Play, it will be rejected. Options to generate your personal private keys (required for publishing on Google Play) will be added in the coming weeks when we know it's all working properly.

 

Thanks for helping us out with some testing :)

Gio

Some problems with the first tests yesterday and early today, so there's a new version up and running now.

 

One thing I should add: don't load things off the network in your apps (like jQuery for example). While this is normally OK, your app needs permissions on Android to access the network. This first version of the apk builder doesn't set any permissions, so your app will silently fail to download resources. It's something that will be possible in future iterations though.

Post a reply
Add Attachment
Submit Reply
Login to Reply