在 HTML5 音频中,我可以做到 this to find out if MP3 is supported :
var a = document.createElement('audio');
return !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
Web Audio API 有类似的功能吗?还是我应该使用相同的功能?
最佳答案
您可以使用相同的功能。
Web Audio API 不支持除音频元素支持的格式之外的其他格式。
目前有:
来源:
https://en.wikipedia.org/wiki/HTML5_Audio
只是为了使其更正,因为此表中存在错误:IE 确实同时支持 Wav 和 Ogg。 请参阅:https://www.microsoft.com/web/post/adding-audio-with-the-new-html5-audio-tag
关于javascript - 网络音频 - 检查支持的格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17396882/