- Home /
Is it possible to modify the DopplerFactor in Edit->ProjectSettings->Audio on-the-fly per scene?
For various reasons, we were forced to use individual scaling of our scenes, so several scenes are no longer in Meters. However, the Doppler Factor in Edit->ProjectSettings->Audio is a project-wide setting.
Is it possible to access the DopplerFactor from within the application, so we can modify it in each scene individually? Otherwise, the doppler effect sounds very distorted in some scenes, and is barely noticeable in others.
Answer by brandon1 · Feb 17, 2011 at 03:03 PM
The AudioSettings class doesn't expose it so I would say probably not that easily. AudioSource has doppler level, so you could do this each time a scene loads:
float someDoppler = 0.45f;
foreach(AudioSource source in Resources.FindObjectsOfTypeAll(typeof(AudioSource)))
{
source.dopplerLevel = someDoppler;
}
I noticed AudioSource.dopplerLevel some time ago, too, and I'm relatively sure it got added in 3.x and was not present in 2.6, because this parameter at least makes it possible to create a workaround-script that individually adjusts the doppler factor to our liking. Thanks for the answer.
Answer by HolBol · Aug 03, 2010 at 01:13 PM
I have a better idea: Change the scale factor of your meshes when you import them so they will be in meters afterwards :) might be a bit simpler for you.
Our imported models usually are, but as I mentioned it is not always possible to have all our scenes/models in $$anonymous$$eters or realistic dimensions: Sometimes we use huge Terrains (>100km), sometimes we have closeups of tiny models, etc. And sometimes we use the same imported model in a number of differently scaled scenes. :-/
Your answer
Follow this Question
Related Questions
3D Audio: Selectively Apply the Doppler Effect. 2 Answers
Creating a Sound setting and saving it. 0 Answers
Audio Settings Menu 2 Answers
How to loop a sound clip on a ButtonDown function 1 Answer
Need help making an audio trigger. 2 Answers