HTML5 audio formats details and conversion


There are basically for options to choose from: WAV, MP3, OGG and AAC. 
HTML5 browser audio support: These browsers were tested on windows 7. The AAC audio was in .m4a format

Browser					Ogg		MP3		AAC		WAV
Internet Explorer9		        No		Yes		Yes		No
Firefox 5 				Yes		No 		No 		Yes
Chrome 12 				Yes 	        Yes 	        Yes		Yes
Safari 5 				No		Yes		Yes 	        Yes
Opera 11.5 				Yes		No		No		Yes

MIME Types for Audio Formats
Format 			MIME-Type
mp3				audio/mpeg
ogg				audio/ogg
wav				audio/wav

HTML5 Audio Tags
Tag				Description
<audio>                   Defines sound content
<source>                  Defines multiple media resources for media elements, such as <video> and <audio>

Example,

<audio controls>
<source src="filename.ogg" type="audio/ogg">
<source src="filename.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

To check your browser support html5 tags, check below link
http://html5test.com

Now, audio format conversion using ffmpeg

———WAV———-
1) wav to mp3
– ffmpeg -i audio.wav -acodec libmp3lame audio.mp3

2) wav to ogg
– ffmpeg -i audio.wav -acodec libvorbis audio.ogg

3) wav to aac
– ffmpeg -i audio.wav -acodec libfaac audio.aac

4) wav to ac3
– ffmpeg -i audio.wav -acodec ac3 audio.mp3

———OGG———-

1) ogg to mp3
– ffmpeg -i audio.ogg -acodec libmp3lame audio.mp3

2) ogg to wav
– ffmpeg -i audio.ogg audio.wav

3) ogg to aac
– ffmpeg -i audio.ogg -acodec libfaac audio.aac

4) ogg to ac3
– ffmpeg -i audio.ogg -acodec ac3 audio.ac3

———AC3———-

1) ac3 to mp3
-> ffmpeg -i audio.ac3 -acodec libmp3lame audio.mp3

2) ac3 to wav
-> ffmpeg -i audio.ac3 audio.wav

3) ac3 to aac
-> ffmpeg -i audio.ac3 -acodec libfaac audio.aac

4) ac3 to ogg
-> ffmpeg -i audio.ac3 -acodec libvorbis audio.ogg

———AAC———-

1) aac to mp3
-> ffmpeg -i audio.aac -acodec libmp3lame audio.mp3

2) aac to wav
-> ffmpeg -i audio.aac audio.wav

3) aac to ac3
-> ffmpeg -i audio.aac -acodec ac3 audio.ac3

4) aac to ogg
-> ffmpeg -i audio.aac -libvorbis audio.ogg

– = more command = –
-> ffmpeg -i audio.mp3 audio.wav
-> ffmpeg -i audio.mp3 -acodec libvorbis audio.wav
-> ffmpeg -i audio.mp3 -acodec libvorbis audio.ogg

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s