What sound file format does HTML5 support?

Monkey Targets Forums/HTML5/What sound file format does HTML5 support?

matty(Posted 2011) [#1]
According to the docs the following formats are supported (although I must say I've had difficulty getting m4a's to work as music for flash..I have to use mp3s).

However - none of them are listed against html5...does that mean there is no sound in html5?

Also, not all audio formats are supported by all targets:

wav : glfw, android, ios
mp3 : flash, android, ios
m4a : flash, android (PlayMusic only), ios
ogg : android


therevills(Posted 2011) [#2]
Welcome to the messy world of HTML5 sound >:)

I like Mark's comments in audiotest.monkey:

#Elseif TARGET="html5"
		'Less than awesomely, there appears to be no 'common' format for html5!
		'Opera/Chrome appear to handle everything, but...
		'IE wont play WAV/OGG
		'FF wont play MP3/M4A
		'Let's support OGG!
		fmt="ogg"		'use M4a for IE...



MonkeyPig(Posted 2011) [#3]
Marks comment seems to suggest that Chrome will at least make some noise (and I'm fairly sure it did) but right now running MonkeyPro43->Audiotest in Chrome or IE9 I get complete silence.

@Matty - is this what you're experiencing?


marksibly(Posted 2011) [#4]
Hi,

Audiotest works fine here in Chrome.


MonkeyPig(Posted 2011) [#5]
Okay - works for me now too.

I restarted Chrome and it works. Sorry! Chrome was just silently failing.


matty(Posted 2011) [#6]
I've only tried it on Firefox and I get no sound. I have chrome at work, but not at home so haven't been able to test it yet on chrome.


QuietBloke(Posted 2011) [#7]
Should Safari work ? Im sure it used to. ( Safari on a Mac )

I've tried playing mp3 and wav and neither play. They play fine in chrome.


Soap(Posted 2011) [#8]
What most HTML 5 games right now (like chrome.angrybirds.com) is play the music and sound effects by a Flash swf proxy.


TheRedFox(Posted 2011) [#9]
Firefox supports .ogg for music and .wav for sound effects.

At least, that's what I have working with diddy. (@therevills: I am learning a lot of Monkey stuff with it, thanks!)


MikeHart(Posted 2011) [#10]
I am using OGG files for sound effects in firefox and go by the formats of the autotest sample script.


QuietBloke(Posted 2011) [#11]
I want to play sounds in Safari. Apparently it supports wav and mp3's but tweaking to sound test to use either of these still does not work.

If in finder I click on the sound files and choose to open with Safari they play no problem.

Has anyone managed to play a sound in safari ?