This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17411 - (AudioPannerNodeUnits): AudioPannerNode units are underspecified
Summary: (AudioPannerNodeUnits): AudioPannerNode units are underspecified
Status: CLOSED WONTFIX
Alias: None
Product: AudioWG
Classification: Unclassified
Component: Web Audio API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: TBD
Assignee: This bug has no owner yet - up for the taking
QA Contact: This bug has no owner yet - up for the taking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-05 12:40 UTC by Michael[tm] Smith
Modified: 2014-10-28 17:16 UTC (History)
3 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2012-06-05 12:40:01 UTC
Audio-ISSUE-62 (AudioPannerNodeUnits): AudioPannerNode units are underspecified [Web Audio API]

http://www.w3.org/2011/audio/track/issues/62

Raised by: Marcus Geelnard
On product: Web Audio API

https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioPannerNode

What are the units of the set* vectors? AudioListener.speedOfSound has the unit m/s. If that is correct (?), the set* vectors should use meters and meters / second too.

Suggestion: Don't use meters (not in AudioPannerNode, and not in AudioListener), to allow for custom unit systems.

Also, the units of coneInnerAngle, coneOuterAngle and coneOuterGain are undefined.
Comment 1 Chris Rogers 2012-11-14 20:18:22 UTC
Similar to OpenAL, the units used in the coordinate system are not defined, and do not need to be.

Quoting from the OpenAL spec:
http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.pdf

3.3. Space and Distance
OpenAL does not define the units of measurement for distances. The application is free to
use its own units, for example, meters, inches, or parsecs. OpenAL provides means for
simulating the natural attenuation of sound according to distance, and to exaggerate or
reduce this effect. However, the resulting effects do not depend on the distance unit used
by the application to express source and listener coordinates. OpenAL calculations are
scale invariant.

Fixed:
https://dvcs.w3.org/hg/audio/rev/b21b04a1ec0e
Comment 2 Marcus Geelnard (Opera) 2012-12-03 09:32:51 UTC
One more thing: Section 4.15. The AudioListener Interface reads "// in meters / second (default 343.3)" for the speedOfSound attribute, which is obviously wrong, then.
Comment 3 Chris Rogers 2012-12-03 23:23:18 UTC
(In reply to comment #2)
> One more thing: Section 4.15. The AudioListener Interface reads "// in
> meters / second (default 343.3)" for the speedOfSound attribute, which is
> obviously wrong, then.

Sorry Marcus, I wasn't clear about that part.  The doppler effect uses the .speedOfSound attribute in conjunction with the velocity vectors for both the AudioPannerNode and the AudioListener.  These velocity vectors are in meters/second and are independent of the units used for position and orientation.  This is taken directly from the OpenAL specification.

Added more specific text for the setVelocity() methods and also added the doppler shift algorithm which uses these values.

Fixed:
https://dvcs.w3.org/hg/audio/rev/f4bef40f3efe
Comment 4 Marcus Geelnard (Opera) 2012-12-04 10:26:01 UTC
(In reply to comment #3)
> Sorry Marcus, I wasn't clear about that part.  The doppler effect uses the
> .speedOfSound attribute in conjunction with the velocity vectors for both
> the AudioPannerNode and the AudioListener.  These velocity vectors are in
> meters/second and are independent of the units used for position and
> orientation.  This is taken directly from the OpenAL specification.

I still don't understand why we need to have a unit at all (I see nothing in the algorithm that depends on actual units). Could it not be unit-less, and work just as it is? It would be confusing (IMO) to force the usage of m/s for some vectors, and then let people use whatever they want (e.g. inches or miles) for other vectors.

I'd personally prefer an all-or-nothing solution: either all vectors are in m and m/s, or they are all in [custom] and [custom]/s, or possibly even [custom_length] and [custom_length]/[custom_time] (like miles/h).
Comment 5 Chris Rogers 2012-12-04 18:34:46 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Sorry Marcus, I wasn't clear about that part.  The doppler effect uses the
> > .speedOfSound attribute in conjunction with the velocity vectors for both
> > the AudioPannerNode and the AudioListener.  These velocity vectors are in
> > meters/second and are independent of the units used for position and
> > orientation.  This is taken directly from the OpenAL specification.
> 
> I still don't understand why we need to have a unit at all (I see nothing in
> the algorithm that depends on actual units). Could it not be unit-less, and
> work just as it is? It would be confusing (IMO) to force the usage of m/s
> for some vectors, and then let people use whatever they want (e.g. inches or
> miles) for other vectors.
> 
> I'd personally prefer an all-or-nothing solution: either all vectors are in
> m and m/s, or they are all in [custom] and [custom]/s, or possibly even
> [custom_length] and [custom_length]/[custom_time] (like miles/h).

I'm just taking this interpretation from the OpenAL specification.  But you're right, we could just say that .speedOfSound is the speed in arbitrary units which are also used by the velocity vectors.  These units are independent of the units used for position and orientation vectors.

How does that sound?
Comment 6 Marcus Geelnard (Opera) 2012-12-05 08:29:31 UTC
(In reply to comment #5)
> I'm just taking this interpretation from the OpenAL specification.  But
> you're right, we could just say that .speedOfSound is the speed in arbitrary
> units which are also used by the velocity vectors.  These units are
> independent of the units used for position and orientation vectors.
> 
> How does that sound?

That sounds like the better choice, yes. I'm sure there are some reasons why OpenAL uses m/s, but unless we know why and it's a strong enough reason, I don't think that it's enough for us to just duplicate that part.

PS. One guess as to why OpenAL want to use m/s it so that the default speed of sound = 343.3 makes sense. On the other hand, this is kind of similar to the gravity property in the Bullet physics library, which defaults to a unit-less 10 (all things are unit-less in Bullet).
Comment 7 Olivier Thereaux 2014-10-28 17:13:51 UTC
Web Audio API issues have been migrated to Github. 
See https://github.com/WebAudio/web-audio-api/issues
Comment 8 Olivier Thereaux 2014-10-28 17:16:46 UTC
Closing. See https://github.com/WebAudio/web-audio-api/issues for up to date list of issues for the Web Audio API.