# Regulation speed of sound

hi,

i have some important questions about setting the speed of sound. I need this for my car code to fit the sound speed for acceleration.

pitch was not a good because of the boundaries of 0.5-2.

:?

Where’s the question!? What’s the problem!? I don’t understand…

I think I understand. He wants to pitch the audio along with the car speed and complains about the limitation from 0.5x to 2x in pitch change. Maybe try using multiple samples, differently pitched in an audio editor before and then switching between them. Also remember a real car has gears.

I’m trying to remember the math for how fast a car would have to travel before the doppler shift is greater than 2x. But I guess that’s only one octave change… you are the sound guy so I will defer to your experience here.

I think its down to the basic motor rotation pitch here Doppler is built into OpenAL afaik…?

ok i have found it now. its called velocity, sorry i’m a real beginner in jme3.

but how to handle increasing my sound velocity. has someone a short examplecode?

Velocity? Thats something else… For that you simply move the audio node like any other node…?

I thought you meant this:

hehe yes, yes i want to increase the velocity of my AudioNode

Heres the example:

[java]

AudioNode car = new AudioNode(assetManager, "Sounds/carsound.wav");

car.setVolume(100);

car.setLooping(true);

boom.play();

// With this values the car sounds like idle

car.setVelocity(new Vector3f(1,1,1));

// For higher speed i need higher velocity

car.setVelocity(new Vector3f(50,50,50));

[/java]

but the problem is how to let this increase smoothly from one value to other?

@ normen

Hab gerade gesehen, dass du auch aus Deutschland bist. Ich schreib es jetzt mal auf Deutsch, sonst wird das nichts mehr.

Also mein Anliegen ist, dass ich die Geschwindigkeit meines AudioNodes erhöhen will, sodass der Effekt entsteht, schneller zu fahren.

Ich denke bei pitch bin ich an der falschen Adresse. Gibt es keine Methode dafür, die Geschwindigkeit zu erhöhen?

Gruß Markus

Hängs ans Auto. Wenn Du tatsächlich die Abspielgeschwindigkeit vom Sound meinst, das ist effektiv pitch.

Ja genau, aber wieso erlaubt jme3 bloß eine maximal doppelte Abspielgeschwindigkeit?

Tja, das Leben ist eins der Härtesten. Lösung hab’ ich schon angeboten, nimm mehrere Sounds in verschiedenen Tonhöhen. Normale Sounds klingen über 2x schneller oder langsamer auch nicht gut.

The velocity of an object is given in meters per second. If you can compute your vehicle’s speed in those units you can then set the AudioNode associated with the vehicle’s motor to that value using AudioNode.setVelocity(), and (assuming your world units are meters) you should have the correct effect. See the TestDoppler example for more details.