[Openal-devel] Distance units

Andrew McDonald myrmecophagavir at hotmail.com
Tue Mar 15 14:37:57 PST 2005


I don't see why everyone's getting so excited about whether or not we have units. Effectively we 
*do* - the OpenAL distance unit and the OpenAL time unit (which is already a second I believe in the 
spec). It's just that they aren't explicitly related to any "real" units. It's actually an 
assumption we're making that the original 343.3 is in metres per second - it might just as well be 
an unhelpful default speed of sound in feet per hour for some random atmosphere. In fact it's simply 
in the same units as the velocity values in the doppler equation.

I would be much happier with just specifying the speed of sound as a global constant, in the same 
units as my velocity values. That would be used by all effects that require the speed of sound as a 
parameter in their equations. To tweak or disable doppler specifically, use the per-source doppler 
factor I suggested. I wouldn't be averse to setting this on all my sources, you have to do a bit of 
per-source set up anyway so it's not much to ask at source creation time. I don't see a problem with 
effects/extensions sharing a single speed of sound constant as long as they have individual controls 
for artistic tweaking, which I would expect anyway. All these presets and distance factors etc seem 
to make a very complex API, without any *real* benefit that I can see... just my tuppence anyway :-p

The issue is what to pick as a default value for these things. A speed of sound of 0 will not 
produce any sound, but since perhaps that wouldn't actually be useful to anyone anyway maybe we 
could say that's a special case for representing infinity? An alternative is to specify the 
reciprocal which could default to 0, but that makes for messier API calls and isn't actually 
mathematically better.

Andrew 



More information about the Openal-devel mailing list