racing sound

hi folks,

im a new member of the totally crazy unity engine.
i started a project and i now have a question.

in the 1.6 version unity supports audio.pitch.
i tried to add a sound to my racing car, and it works.
now i have a problem. if the car is moving faster, it should pitch the sound variable from .5 to 2.0.

i tried to add audio.pitch to the tutorial car script.
it looks like audio.pitch = 1.0 * rpm.
the rpm is computed in the tutorial car script…

no error message, but nothing happens.

could someone please help me?
i am not a freakin coder, but i want to become one.

thanks all in advance

The doppler doesnt work on ppcs if thats a help
AC

I understand that the Doppler Effect doesn’t work on OS X PPC machines, but I didn’t realise that AudioSource.pitch doesn’t work either.

That sucks.

Ack; I hadn’t tried the new sound stuff yet so I didn’t know that. Is that going to be fixed I hope?

–Eric

Ouch, I didn’t realize this either. Is this fixable or just a sign of the times of starting to leave the PPC architecture behind?

yea, i hadnt realised this yet either…is there going to be a ppc fix?

I would imagine that the Doppler effect is created using audioSource.pitch, so their fates are probably intertwined.

I personally doubt PPC will be supported for this in the future, but I can’t speak for OTEE.

Its on the cards I thought. Unity2 I think. google doppler on the docs
AC

Sorry, i don´t understand.

if an audiosource has got the parameter .pitch it works if i modify this.

but doing audio.pitch in the car script, it doesnt work.
is there sombody out there who can tell me how to do audio pitching with my car?

is there some other solution around?

thanks you

ps. i got an intel mac

Doppler and pitch does work on several PPC machines we have here. For anyone that has it not working, please run Report Bug.app, write like “doppler does not work, ppc” and send it to us. Hopefully that will give us some insight why it’s not working.

hopefully i don´t be misunderstand.
my problem is a personal one, i dont know how to script a changing sound for my race car.

it isn´t not a unity one, or am i wrong?

if somebody created a race game, he must have the same problem.
how to modify the race sound ?
sorry for my bad english, its not my mother tongue…

i’ll stop bitching as im only going on what i’ve read here!..I will get around to actually testing out the new audio stuff myself on the powerbook G4 here at some point soon and see how it goes.

in theory,

audio.pitch = 1.0 * rpm

is what about you want, but if you just take the rpm parameter from the car example, you’d have a range from ~800 to 6000, which will give you pitches way out of reach for OpenAL.
Also, I wouldn’t scale engine pitch proportionally with RPM (doesn’t sound realistic). Try something like this instead:

audio.pitch = 0.5+0.9*rpm/maxRPM

you might also want to make the volume correspond to throttle input.

ok, thanks jonas, i will try this @ home.

to put this to the controller-input is a good idea.

but anymore, are there no questions about doing engine sound in racing games?

thanks again

Just to put it firmly: we are not dropping PPC support anytime soon. There seem to be some problems with pitch on some PPCs and we’ll work on that.

d.

thanx to all.

it works :slight_smile:

great community i love unity thank u ottee

great
just for the record, I wasnt complaining. I dont understang doppler carry-on yet, but I did search the docs and found this, so I was making my statement based on that
AC

25119--907--$picture_17_152.png

That documentation is outdated :slight_smile:
Doppler works on ppc and intel (I realise that there are some bugs with this in the different implementations, the ppc should be fine now, looking into intel later).

I’ve had quite a bit of audio experience, but a doppler is a new concept to me. Is there a good example of using this anywhere? Maybe someone from OTEE could knock up a wee package? Prudy Please?
AC

Doppler is mostly interesting if you have objects with high velocities relative to each other. Like a car or plane passing by. Just try setting up a looping sound source attached to an object which is passing the camera at a high speed to get an impression of the effect.