Audio not working on Android?

Monkey Targets Forums/Android/Audio not working on Android?

Virtech(Posted 2011) [#1]
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



Xaron(Posted 2011) [#2]
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...


Virtech(Posted 2011) [#3]
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 :(


Xaron(Posted 2011) [#4]
Does any of the examples work on your Galaxy?


Virtech(Posted 2011) [#5]
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.


Xaron(Posted 2011) [#6]
Hmm... I did not take a deeper look but thought that the horse example has some sound files?


Virtech(Posted 2011) [#7]
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...


Xaron(Posted 2011) [#8]
Well give it some time. Monkey just has been born, it is still very young but the most promising multipltform thing out there.


Virtech(Posted 2011) [#9]
Time is precious! :) I wish Monkey will be too ;)


Canardian(Posted 2011) [#10]
Maybe try as ogg file?


Virtech(Posted 2011) [#11]
Did try .ogg (see 1st post) - no go


Virtech(Posted 2011) [#12]
Does anyone else miss sound in vanilla firefox running the horse example? I hope its just me...


okee(Posted 2011) [#13]
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>


xlsior(Posted 2011) [#14]
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)


Virtech(Posted 2011) [#15]
I hope Mark will improve this soon. If not, maybe a module could be done to port an audio engine for Android. OpenAL perhaps?