Re[Openal] garding Doppler Effect
Daniel PEACOCK
dpeacock at creativelabs.com
Mon Sep 15 02:34:33 PDT 2008
Hi,
Assuming all your units are in meters and time is in seconds.
Each game frame (or audio update frame) you need to update the Listener's
Position and Velocity ...
alListenerfv(AL_POSITION, vNewPos);
// Velocity is change in position over time ...
vVel = (vNewPos - vOldPos) / timeSinceLastFrame;
alListenerfv(AL_VELOCITY, vVel);
For each Source ...
alSourcefv(sourceID, AL_POSITION, vNewSourcePos);
vVel = (vNewSourcePos - vOldSourcePos) / timeSinceLastFrame;
alSourcefv(sourceID, AL_VELOCITY, vVel);
Doppler will be applied to any Source that has a relative velocity compared
to the Listener. i.e it can be due to the Source moving, or the Listener
moving, or both.
Dan
Creative Labs (UK) Ltd.
Notice
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or
any action taken by you in reliance on it, is prohibited and may be
unlawful. If you have received this message in error, please delete it
and contact the sender immediately. Thank you.
OpenGeek
<abhishek.s.dey at l
ive.com> To
Sent by: openal at opensource.creative.com
openal-bounces at op cc
ensource.creative
.com Subject
Re: Re[Openal] garding Doppler
Effect
09/13/2008 04:24
PM
I understand that the doppler effect in OpenAL is velocity dependent. But
what if a Game scene is changing its coordinates to new one? How to
calculate the velocity of sound using Listener's Position? Can Listener
position be changed in alListenerfv(ListenerPos)? Does it also implies that
the listener has to be in constant motion to create Doppler Effect? What
Functions are there in OpenAL to be used in Doppler shifting mechanism?
Please consider these questions for a newbie. I was unable in finding a 'to
the point' information as how openal is helping us in acheiving
:confused:Doppler effect.
Thanking you.
Daniel PEACOCK wrote:
>
>
>
>
>
> The OpenAL1.1 Specification includes some information about Doppler (
>
http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835873
> ).
>
> To use Doppler properly you must know how your units relate to real world
> units. This is because Doppler is modelling how the pitch of a sound
> varies based on how fast the sound is travelling and whether it is moving
> towards the Listener or moving away from it.
>
> By default, units are assumed to be in meters (and velocities in meters
> per
> second). The AL_SPEED_OF_SOUND property therefore defaults to 343.3
> (speed of sound travelling through the air in meters per second).
> Assuming you are using meters for your units then all you need to do is
> update each moving AL Source with a Velocity vector (note velocity is
> *not*
> generated automatically based on changes in Source position) and if the
> Listener is also moving you can also set a Listener Velocity parameter
> too.
>
> If you are using Windows, and have the Creative OpenAL SDK, you can use
> the
> included EFX10Show application to play with the Doppler related
parameters
> to see how things interact.
>
> Dan
> Creative Labs (UK) Ltd.
>
> Notice
> The information in this message is confidential and may be legally
> privileged. It is intended solely for the addressee. Access to this
> message by anyone else is unauthorized. If you are not the intended
> recipient, any disclosure, copying or distribution of the message, or
> any action taken by you in reliance on it, is prohibited and may be
> unlawful. If you have received this message in error, please delete it
> and contact the sender immediately. Thank you.
>
>
>
>
>
> OpenGeek
> <abhishek.s.dey at l
> ive.com>
To
> Sent by: openal at opensource.creative.com
> openal-bounces at op
cc
> ensource.creative
> .com
Subject
> Re[Openal] garding Doppler Effect
>
> 09/11/2008 05:21
> AM
>
>
>
>
>
>
>
>
> Can anyone explain me the OpenAL Doppler effect and its usage??
> --
> View this message in context:
> http://www.nabble.com/Regarding-Doppler-Effect-tp19337740p19337740.html
> Sent from the OpenAL - User mailing list archive at Nabble.com.
>
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
> ForwardSourceID:NT00064CB2
>
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
>
--
View this message in context:
http://www.nabble.com/Regarding-Doppler-Effect-tp19337740p19471602.html
Sent from the OpenAL - User mailing list archive at Nabble.com.
_______________________________________________
Openal mailing list
Openal at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal
ForwardSourceID:NT00064EAE
More information about the Openal
mailing list