Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 网络音频API延迟,反馈崩溃_Javascript_Google Chrome_Crash_Delay_Web Audio Api - Fatal编程技术网

Javascript 网络音频API延迟,反馈崩溃

Javascript 网络音频API延迟,反馈崩溃,javascript,google-chrome,crash,delay,web-audio-api,Javascript,Google Chrome,Crash,Delay,Web Audio Api,每次我试图在反馈延迟的情况下运行代码时,我的Chrome浏览器都会崩溃,我的蓝屏会显示: “啊,啪! 显示此网页时出错。若要继续,请重新加载或转到其他网页。“ 我的代码使用这种结构: //Create any kind of input (only to test if it works or not); var oscillator = context.createOscillator(); //Create the delay node and the gain node used on

每次我试图在反馈延迟的情况下运行代码时,我的Chrome浏览器都会崩溃,我的蓝屏会显示:
“啊,啪!
显示此网页时出错。若要继续,请重新加载或转到其他网页。“

我的代码使用这种结构:

//Create any kind of input (only to test if it works or not);
var oscillator = context.createOscillator();

//Create the delay node and the gain node used on the feedback
var delayNode = context.createDelay();
var feedback = context.createGain();

//Setting the feedback gain
feedback.gain.value = 0.5;

//Make the connections
oscillator.connect(context.destination);
oscillator.connect(delayNode);
delayNode.connect(feedback);
feedback.connect(delayNode);
delayNode.connect(context.destination);//This is where it crashes

您是否将panner节点放在延迟节点之后

我也有类似的问题。
在我的例子中,它就像一个panner节点的bug

调试了几个小时后,我发现了这个页面:

它表示延迟后连接panner节点会导致问题。
如果您的代码实际上是这样的,它将崩溃

var pannerNode = context.createPanner();
delayNode.connect(pannerNode);
pannerNode.connect(context.destination);
我的程序就是这样的代码。 当我从程序中删除panner节点时,它工作得很好

因此,如果您在同一场合,您可以通过自己编写panner来避免问题。
这是我为我的程序编写的一个示例(用CoffeeScript)


我希望这将对您有所帮助。

什么是Chrome浏览器版本,您能显示完整的代码吗?因为我一直使用反馈延迟循环。它会在创建节点时崩溃吗?开始()调试振荡器?我使用的是Chrome 31.0.1626.0 dev。它正好在我运行代码的最后一行delayNode.connect(context.destination)时崩溃。这是在调试模式下运行的实际代码的视频。这不是一个残酷的无限循环吗?osc->延迟反馈,然后延迟到目的地?感谢@jsantell的回复,但这不是建立反馈延迟的方法吗?
class @Panner
constructor: (@ctx) ->
    @in = @ctx.createChannelSplitter(2)
    @out = @ctx.createChannelMerger(2)
    @l = @ctx.createGain()
    @r = @ctx.createGain()
    @in.connect(@l, 0)
    @in.connect(@r, 1)
    @l.connect(@out, 0, 0)
    @r.connect(@out, 0, 1)
    @setPosition(0.5)

connect: (dst) -> @out.connect(dst)

setPosition: (@pos) ->
    @l.gain.value = @pos
    @r.gain.value = 1.0 - @pos