Hello, I am using *.ogg files for my background music and a few other sounds. My problem is, it works just fine when I run it in browser, but as soon as I build a apk or exe from the cloud, I LOSE ALL SOUND. Can anyone help me with this? Thanks!
Is this happening on both Android and Windows?
Do you actually lose ALL sound, not just the ones that autoplay when the game loads?
I lose all sounds on the whole game, which is only about 4 obb files. I have tried it on both android and windows, nothing else yet. I have also tried to compile it on my own with Intel XDK with the same result. Thanks for replying Gio, good to hear from you again.
Well it could be the specific encoding of the files that your phone browser (wrapper) doesn't like. How did you generate those .ogg files? is the sampling rate 44.1Khz?
A good way of doing it is through the free program Audacity.
I didn't generate the .ogg files myself, but I did just download Audacity and ran all my .ogg files through it to change the rate to 44.1. So now all 4 of my .ogg files have that rate, and the audio is still working in my computer browser when I preview it, but when I make a .apk file and try it on my phone I still don't get any audio at all. I have also tried enabeling the 'web audio only' on all of my scenes, but that didn't work either. I am just trying to get it to work with android and ios, should I be using .mp3 files instead?
For ios you probably want .aac. For android, I'd stick with .ogg as .mp3 have some licensing issues - they might work, but technically you'd need a (pretty expensive) licence to legally use them.
Have you added all your files to the list of assets for the current scene in the scene properties? You should probably do that AND use the WebAudio Only option to ensure they get loaded before you use them.
If that still doesn't work, you probably want to see whether WADE is detecting any errors when you run it on your phone. You could use proper debugging tools, but a quick and easy way to do it is to add this line at the very top of your app.js:
wade.log = function(x) {alert(x)}
I'm not sure if this will help, but here is a link to my source code: https://drive.google.com/file/d/0B4xnR-xPQu44WjZkc0J1bVh2Zzg/view?usp=sharing
Looks like a pretty big project :)
I haven't really opened it yet, but looking at your scene data it seems that the audio files are not listed there. They need to be added in the right-hand panel in the scene properties, when no objects are selected.
I would also select WebAudio only.
You'd have to do this for every scene. As you've got many scenes, you may prefer to manually edit the wsc files (it's up to you) - they are just JSON files, and if you're doing this manually you want to ensure that they all have an "audio" array like this:
"audio": ["myFile1.ogg", "myFile2.ogg", "myFile3.ogg"]
YEP! That was it, don't know how I missed that. Its all working now! THANK YOU! When it's finished, I'll post it here for all to see.
New (working) Source Code: https://drive.google.com/file/d/0B4xnR-xPQu44ekwwQWQtWnJDbTg/view?usp=sharing