工作示例MediaElementAudioSourceNode与Chrome Canary版? [英] Working example for MediaElementAudioSourceNode with Chrome Canary?
问题描述
我的<一个实验href=\"http://chromium.google$c$c.com/svn-history/r2003/trunk/samples/audio/specification/specification.html\"相对=nofollow> W3C网络音频API 实施和谷歌Chrome Canary版启用的基础之上。 (我在Windows 7 X64的15.0.865.0金丝雀目前)的演示应用的工作就好了。
I'm experimenting with the W3C Web Audio API implemented and enabled in Google Chrome Canary builds. (i have 15.0.865.0 canary on Windows 7 x64 at the moment) Demo applications work just fine.
我喜欢用<一个href=\"http://chromium.google$c$c.com/svn-history/r2003/trunk/samples/audio/specification/specification.html#MediaElementAudioSourceNode-section\"相对=nofollow> MediaElementAudioSourceNode
,因为我喜欢玩一个更大的OGG音乐。对于这样的音频文件的API说我应该用这个来代替 AudioBufferSourceNode
。
我写了一个很简单的例子:
I've written a very simple example:
<script type="text/javascript">
var audioElement = document.createElement('audio');
audioElement.setAttribute('src', 'dubfx.ogg');
var audioContext = new webkitAudioContext();
var streamingAudioSource = audioContext.createMediaElementSource(audioElement);
streamingAudioSource.connect(audioContext.destination);
</script>
不过,我刚刚听到的点击,而不是实际的音频。我看到在JavaScript控制台中没有任何错误,所以我猜code是好的,也许一些初始化丢失。如果我叫 audioElement.play()
,而不是通过网络音频API的路由,音乐播放就好了。我错过了什么或者当前的WebKit的执行被打破?
However i just hear clicks instead of actual audio. I see no errors in the JavaScript console so i guess the code is okay, maybe some initialization is missing. If i call audioElement.play()
instead of the routing through the Web Audio API, the music plays just fine. Did i miss something or maybe the current WebKit implementation is broken?
推荐答案
刚问过克里斯·罗杰斯(规范编辑)这个今天。在 MediaElementAudioSourceNode
在加那利露/铬建立,但内部没有迷上了呢。这将是一个较长的同时,您可以使用在&LT;音频方式&gt;
通过网络音频API标签
Just talked to Chris Rogers (the spec editor) about this today. The MediaElementAudioSourceNode
is exposed in Canary/Chromium builds but the internals are not hooked up yet. It'll be a while longer before you can use the <audio>
tag with the Web Audio API.
这篇关于工作示例MediaElementAudioSourceNode与Chrome Canary版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!