質問

The Web Audio API spec states that the ScriptProcessorNode.bufferSize property value "will be picked by the implementation if the bufferSize argument to createScriptProcessor is not passed in, or is set to 0".

Elsewhere is states that "It is recommended for authors to not specify this buffer size and allow the implementation to pick a good buffer size to balance between latency and audio quality." when calling createScriptProcessor().

However, when I use either a value of zero or call createJavaScriptNode() without the bufferSize argument an error is thrown in the Developement console:

Uncaught SyntaxError: An invalid or illegal string was specified.

This error is erroneous, I've verified that the argument is a number, not a string.

However the createScriptProcessor() result fails and the debugger will stop on the line that calls createScriptProcessor() if you set it to 'Pause on uncaught exceptions'.

It seems to me Chrome doesn't support the auto value and the bufferSize value must be set explicitly to one of these values:

256, 512, 1024, 2048, 4096, 8192, 16384.
  • Does anyone have any experience with this?
  • Does Google Chrome have a ScriptProcessorNode.bufferSize automatic implementation?
役に立ちましたか?

解決

I believe that's a new(ish) addition to the draft.

Chrome (stable) just hasn't caught up yet. But the change has already made its way into Chrome Canary. With no arg or an arg of 0, it'll set a default bufferSize. On my machine (maybe all machines?) it's 512.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top