How do you get realistic sound?

i have had a look around and all i can find is tutorials telling you to use mono wav files and the 3d sound option in blender. but this just does not work. i might be doing something wrong but no matter what options i change the sound is roughly the same volume right next to it as it is miles away from it. so i was going to ask are there any other ways in blender to make the sound more realistic. so it changes massivly depending on the players location. and what is between the player and the sound.

Thanks.

I have always been thinking about this myself. so you can make a sound from a direction

I believe 3d sound just changes the direction (IE which speakers) the sound is coming from- but it should be very simple to write a script that controls volume based on distance, and doesn’t play sounds at all after a cutoff (to save processing power/memory), and doppler shouldn’t be difficult by changing pitch based on velocity in relation to the camera.

Beyond that it would probably take a fair bit of work to get proper sound simulation- it’d probably be better to integrate something like openAL to get advanced sound effects such as muffling through walls or echo.

Blender 2.53 has 3d sounds that are effected by distance.

so does 2.49b for that matter.

thanks for the suggestions. one other thing. if i could make a script that changed the volume depending on the players location how would it work if there were two objects playing the same sound. one closer to the player than the other. would this mess it up or should the objects play the sounds at different volumes without any problems.

You could do this:


c=GameLogic.getCurrentController()
s=GameLogic.getCurrentScene()
o=c.owner

sound=c.actuators['soundActuator']        #Your sound actuator here

player=s.objects['OBPlayer']                  #Your player object name here
distance=o.getDistanceFrom(player)

sound.volume=1/distance                      #You'll have to adjust the formula yourself to get the desired effect

Although If I press the 3d sound button and adjust the factor, this is done automatically.

Good luck!

depends on the quality of the recording, as a matter of fact, i was messing around with mics the other day and i found you should record sounds in stereo, split the channels on the computer and assign them to objects close together,. with 3d sound in the game engine it sounds soooo realistic!

any way thanks again. and thanks for the script. although im not quite sure what you meen by adjust the 3d sound factor. i tried every button and slider i can find and can’t find anyhting that seems to have and effect on the distance. but still the script will be usefull.

and ill remember about splitting the recordings for future but for what im trying to do it would not work as the sound would be playing in random locations. but thanks for the tip.

any way i have an idea for a simple script i could use to make the sound more realistic. so iv found out some books iv got on blender and im going to see if i can script it myself.

any way once again thanks for the help.

ionee can you send a blend file for that example so i can see how it sounds? whould be lovely :slight_smile: