[PannerNode].refDistance throws an exception for value 0.
Reported by
pp.b...@gmail.com,
Dec 7 2016
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2944.0 Safari/537.36 Steps to reproduce the problem: 1. Follow code snippet ``` var audioCtx = new AudioContext(); var panner = audioCtx.createPanner(); panner.refDistance = 0; ``` What is the expected behavior? No error What went wrong? Uncaught RangeError: Failed to set the 'refDistance' property on 'PannerNode': The refDistance provided (0) is less than or equal to the minimum bound (0) Did this work before? N/A Does this work in other browsers? N/A Chrome version: 57.0.2944.0 Channel: canary OS Version: 10.0 Flash Version: It works in Chrome: Version 56.0.2924.18 dev (64-bit)
,
Dec 7 2016
This is a very recent change in the spec: https://webaudio.github.io/web-audio-api/#widl-PannerNode-refDistance refDistance can't be zero or negative any more.
,
Dec 7 2016
This change will create a difference between OpenAL and WebAudio. What might be a surprise for developers that use Emscripten. In OpenAL spec: https://www.openal.org/documentation/openal-1.1-specification.pdf AL_REFERENCE_DISTANCE takes [0, any] ($Table 4-12) Is this something unavoidable?
,
Dec 7 2016
Hmm. I guess a ref distance of 0 is only a real problem for the exponential where you'll always be dividing by 0. Is the default reference distance 0? It defaults to 1 in WebAudio.
,
Dec 7 2016
In our case we use AL_SOURCE_RELATIVE, what forces PannerNode.distanceModel == "linear". According to specification the default value for AL_REFERENCE_DISTANCE is 1.0f. As you noticed, this corresponds with default value for WebAudio.
,
Dec 7 2016
Feel free to file an issue on the spec if you find this important.
,
Dec 7 2016
Thank you @rtoy. Created issue: https://github.com/WebAudio/web-audio-api/issues/1105
,
Dec 7 2016
This issue can be closed.
,
Jan 3 2017
I'm going to leave this open until the spec issue is resolved.
,
Apr 11 2017
The spec issue is closed, allowing 0 for refDistance.
,
Apr 11 2017
,
Apr 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2f69a341b1288a4a6d2e3056f6a2d7609668777e commit 2f69a341b1288a4a6d2e3056f6a2d7609668777e Author: rtoy <rtoy@chromium.org> Date: Wed Apr 12 22:31:39 2017 Allow Panner.refDistance to be 0 Reverts the change that required refDistance to be strictly positive. This was updated in the spec in issue https://github.com/WebAudio/web-audio-api/issues/1105, fixed by https://github.com/WebAudio/web-audio-api/pull/1150 BUG= 672156 TEST=Panner/panner-distance-clamping.html Review-Url: https://codereview.chromium.org/2807313002 Cr-Commit-Position: refs/heads/master@{#464178} [modify] https://crrev.com/2f69a341b1288a4a6d2e3056f6a2d7609668777e/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html [modify] https://crrev.com/2f69a341b1288a4a6d2e3056f6a2d7609668777e/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp [modify] https://crrev.com/2f69a341b1288a4a6d2e3056f6a2d7609668777e/third_party/WebKit/Source/platform/audio/Distance.cpp
,
Apr 13 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by pp.b...@gmail.com
, Dec 7 2016