2013-10-22 64 views
1

我最近讀到HTML 5帶有嵌入音頻文件的標準方式。 我需要使用此功能,但我不知道哪些是支持的文件。什麼是在HTML5中嵌入音頻的支持格式?

<audio controls> 
<source src="track.mp3" type="audio/mpeg"> 
</audio> 

只有mpeg?

感謝

+1

谷歌是你的朋友,看看這個http://www.w3schools.com/html/html5_audio。 asp和http://html5doctor.com/html5-audio-the-state-of-play/ –

回答

5

此標記在Internet Explorer 9 +,Firefox,Opera,Chrome和Safari中受支持。

注意:Internet Explorer 8和更早版本不支持該標記。 標籤定義聲音,如音樂或其他音頻流。

目前,有3種爲元素支持的文件格式:MP3,WAV和Ogg:

Browser MP3 Wav Ogg 
IE  YES NO NO 
Chrome YES YES YES 
Firefox NO YES YES 
Safari YES YES NO 
Opera NO YES YES 

更新:火狐21在Windows 7中,Windows 8,Windows Vista和運行Android現在支持MP3。

MIME類型的音頻FormatsFormat MIME類型

MP3 audio/mpeg 
Ogg audio/ogg 
Wav audio/wav 
2
Internet Exploree: MP3 
Chrome: MP3, WAV, OGG 
Firefox: WAV, OGG 
Safari: MP3, WAV 
Opera: WAV, OGG 

Find More

+1

每個新版本的瀏覽器都支持更多的文件格式。當涉及到任何新的html5功能 –

+1

時,瀏覽器的版本非常重要,有關更多信息,請參閱http://html5readiness.com/。 –

相關問題