New issue
Advanced search Search tips

Issue 672156 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

[PannerNode].refDistance throws an exception for value 0.

Reported by pp.b...@gmail.com, Dec 7 2016

Issue description

UserAgent: 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)
 

Comment 1 by pp.b...@gmail.com, Dec 7 2016

Did this work before? YES
Does this work in other browsers? YES

Comment 2 by rtoy@chromium.org, 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.

Comment 3 by pp.b...@gmail.com, 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? 

Comment 4 by rtoy@chromium.org, Dec 7 2016

Status: Available (was: Unconfirmed)
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.

Comment 5 by pp.b...@gmail.com, 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.

Comment 6 by rtoy@chromium.org, Dec 7 2016

Feel free to file an issue on the spec if you find this important.

Comment 7 by pp.b...@gmail.com, Dec 7 2016

Thank you @rtoy. 
Created issue: https://github.com/WebAudio/web-audio-api/issues/1105 

Comment 8 by pp.b...@gmail.com, Dec 7 2016

This issue can be closed. 

Comment 9 by rtoy@chromium.org, Jan 3 2017

I'm going to leave this open until the spec issue is resolved.

Comment 10 by rtoy@chromium.org, Apr 11 2017

The spec issue is closed, allowing 0 for refDistance.

Comment 11 by rtoy@chromium.org, Apr 11 2017

Owner: rtoy@chromium.org
Status: Started (was: Available)

Comment 13 by rtoy@chromium.org, Apr 13 2017

Status: Fixed (was: Started)

Sign in to add a comment