【发布时间】:2015-03-31 16:23:48
【问题描述】:
昨天,我有a question about the noteOn method of the AudioContext object。 我现在已经在这个 AudioContext 对象上彻底改变了自己。 这是我在桌面上的 Safari 中尝试过的方法及其相关的错误消息:
var ctx
// ctx = new(AudioContext || webkitAudioContext); // ReferenceError: Can't find variable: AudioContext
// ctx = new(audioContext || webkitAudioContext); // ReferenceError: Can't find variable: audioContext
// ctx = new(window.AudioContext || webkitAudioContext); // ReferenceError: Can't find variable: webkitAudioContext
ctx = new(window.AudioContext || window.webkitAudioContext);
// TypeError: 'undefined' is not a constructor (evaluating 'new(window.AudioContext || window.webkitAudioContext)')
问:如何定义 myAudioContext 以使其适用于所有浏览器?
【问题讨论】:
-
我按照HTML5Rocks 上的第一个示例,我得到''Web Audio API is not supported in this browser'。
-
这很有趣。我的帮助关于说我是 Safari 5.1.7...
-
是的,Safari 仅在 6.1 或更高版本上支持 Web Audio API。
-
Apple 说最新版本是5.1.7。
-
这仅适用于 Windows 和 Mac OS X(或更低版本)的 Safari。在 Mac OS Mountain Lion 上,支持的最高 Safari 版本是 6,在 Mavericks 上是 7,在 Yosemite 上是 8(最新版本)。
标签: javascript webkitaudiocontext