Audio not working on Android?
Monkey Targets Forums/Android/Audio not working on Android?
| ||
Hi! The following simple code works fine in html5. But does not play any sound on my Android device (Samsung Galaxy S). I've tryed most common audio file formats, (wav,ogg,mp3,aif) but none works. Does anybody else had success playing audio files on android? Thanks, Import mojo Function Main () New Game End Class Game Extends App Field snd:Sound Method OnCreate () ' Load Sound snd = LoadSound( "ORGAN_2.wav" ) ' Play Sound PlaySound( snd ) End Method OnUpdate () End Method OnRender () End End |
| ||
Hmm... first thing which pops up is case sensitiveness. HTML5 under windows might not that picky. Is the sound really named "ORGAN_2.wav"? (or "organ_2.wav" ir organ_2.WAV...) Just guessing here... |
| ||
Renamed audio filename to lowercase "organ.wav" and update the same in the code. Still plays ok in html5, but no sound at all on android device :( |
| ||
Does any of the examples work on your Galaxy? |
| ||
Yes all monkey examples I've tryed so far on the Galaxy works just fine. Actually they run faster than in firefox/chrome, wich is nice :) However none of them did include sound commands. |
| ||
Hmm... I did not take a deeper look but thought that the horse example has some sound files? |
| ||
Just checked, that exmple does include sound. It loads a couple of mp3 files. - In firefox no sound (haven't tryed chrome ) - On Galaxy no sound. I guess if I convert those mp3 to wav it will atlest work on firefox. But on android it seems its silent movie for now. Corona does also have issues with missing sound on Android. I hoped Monkey could do better... |
| ||
Well give it some time. Monkey just has been born, it is still very young but the most promising multipltform thing out there. |
| ||
Time is precious! :) I wish Monkey will be too ;) |
| ||
Maybe try as ogg file? |
| ||
Did try .ogg (see 1st post) - no go |
| ||
Does anyone else miss sound in vanilla firefox running the horse example? I hope its just me... |
| ||
On my PC, XP Pro SP3 Chrome 9: sound Firefox 3.6.13: no sound safari 5.0.3: sound IE8: I get an error message Typeerror: object doesn't support this property or method and gives 3 files, all of which have paths on warpys computer i.e c:\users\christian..\app.monkey<84> |
| ||
Does anyone else miss sound in vanilla firefox running the horse example? I hope its just me... I hear sound in the Flash version on my PC, but NOT in the HTML5 version (using Chrome 9.0, under windows 7 x64) |
| ||
I hope Mark will improve this soon. If not, maybe a module could be done to port an audio engine for Android. OpenAL perhaps? |