我正在使用一个使用AudioContext来获取频率数据的可视化器。它在 Internet Explorer 中不起作用。
之前的 Stack Overflow 问题有点相关:
HTML5 如何为 javascript 游戏替换 Internet Explorer 的 WebAudio API?
所以,我使用下面的代码来获取 AudioContext
function audioContextCheck()
{
if (typeof window.AudioContext !== "undefined") {
console.log('AudioContext');
return new window.AudioContext();
} else if (typeof webkitAudioContext !== "undefined") {
console.log('webkitAudioContext');
return new window.webkitAudioContext();
} else if (typeof window.mozAudioContext !== "undefined") {
console.log('mozAudioContext');
return new window.mozAudioContext();
} else {
console.log('NONE OF THEM!');
}
}
控制台返回'NONE OF THEM',这意味着 Internet Explorer(版本 11)无法加载任何音频内容。
微软自己的文档是指AudioContext(): https ://msdn.microsoft.com/en-us/library/dn954795(v=vs.85).aspx
我很困惑,我错过了什么吗?