W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

Re: undefined directions in AudioListener and PannerNode setOrientation()

From: Karl Tomlinson <karlt+public-audio@karlt.net>
Date: Mon, 16 Sep 2013 16:42:07 +1200
To: public-audio@w3.org
Message-ID: <8738p5z8bk.fsf@karlt.net>
On Wed, 28 Aug 2013 12:35:53 -0400, Ehsan Akhgari wrote:

> On Sun, Aug 25, 2013 at 10:27 PM, Robert O'Callahan wrote:
>> On Mon, Aug 26, 2013 at 11:37 AM, Karl Tomlinson wrote
>>> Would it make sense to have setOrientation() throw an exception if
>>> any the vectors are zero or otherwise linearly dependent?
>>> It is not possible to determine appropriate panning parameters in
>>> these situations, and the azimuth and elevation from the
>>> calculation in [1] become undefined because an attempt is made to
>>> normalize a zero vector.
>>> If the orientation is not known, then I think it would be better
>>> to retain the previous orientation than to suddenly change to some
>>> default orientation.  Throwing an exception seems the appropriate
>>> way to indicate that a setter method was not successful in
>>> changing anything.
>> With 2D canvas we decided it was better to not throw for singularities
>> because you don't want to break the application when it's doing some
>> animation that passes through a singularity. I think the same logic applies
>> here. So I suggest just silently ignoring the setOrientation call.
> That makes sense to me.

Sounds good to me too, thanks.  I've done this for AudioListener
in Gecko.

I see now that the behaviour for PannerNode cone gain with a zero
orientation vector is specified as 1 in all directions, so I've
kept that specified behaviour.
Received on Monday, 16 September 2013 04:43:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:25 UTC