Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(AudioPannerNodeUnits): AudioPannerNode units are underspecified #135

Closed
olivierthereaux opened this issue Sep 11, 2013 · 8 comments
Closed

Comments

@olivierthereaux
Copy link
Contributor

Originally reported on W3C Bugzilla ISSUE-17411 Tue, 05 Jun 2012 12:40:01 GMT
Reported by Michael[tm] Smith
Assigned to

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.

@olivierthereaux
Copy link
Contributor Author

Original comment by Chris Rogers on W3C Bugzilla. Wed, 14 Nov 2012 20:18:22 GMT

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

@olivierthereaux
Copy link
Contributor Author

Original comment by Marcus Geelnard (Opera) on W3C Bugzilla. Mon, 03 Dec 2012 09:32:51 GMT

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.

@olivierthereaux
Copy link
Contributor Author

Original comment by Chris Rogers on W3C Bugzilla. Mon, 03 Dec 2012 23:23:18 GMT

(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

@olivierthereaux
Copy link
Contributor Author

Original comment by Marcus Geelnard (Opera) on W3C Bugzilla. Tue, 04 Dec 2012 10:26:01 GMT

(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).

@olivierthereaux
Copy link
Contributor Author

Original comment by Chris Rogers on W3C Bugzilla. Tue, 04 Dec 2012 18:34:46 GMT

(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?

@olivierthereaux
Copy link
Contributor Author

Original comment by Marcus Geelnard (Opera) on W3C Bugzilla. Wed, 05 Dec 2012 08:29:31 GMT

(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).

@mdjp
Copy link
Member

mdjp commented Oct 28, 2014

RESOLUTION: doppler issue no longer relevant - pannerNode needs review as part of restructure.

@cwilso
Copy link
Contributor

cwilso commented Oct 29, 2014

The rest of this issue (aside from what is covered in #129) is irrelevant.

@cwilso cwilso closed this as completed Oct 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants