More realistic 3d sound

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Masa
Posts: 5
Joined: Fri Mar 19, 2004 1:11 am

More realistic 3d sound

Post by Masa »

Is there a way that I would be able to change the pitch and volume of the sound if its bouncing off a wall as opposed to line of sight? Is there a way to do that using existing 3dsound formats? I think i can figure it all out if i just know what to start with. Thanks for any help!
Mercior
Posts: 100
Joined: Tue Feb 24, 2004 1:53 am
Location: UK
Contact:

Post by Mercior »

I guess you could use some existing 3d sound code that adjusts volume based on distance from player, but perhaps add a few lines that do a raycast from the player to the sound origin and see if it collides with the world geometry; if it does, then do whatever adjustment to the sound.

Thats the quick hack.. the other option would to perform a raytrace-like bit of maths from the sound to the player so as to calculate the number of bounces, surface info, etc and adjust volume & pitch very realisticly but that would be rather cpu heavy for a game.
Masa
Posts: 5
Joined: Fri Mar 19, 2004 1:11 am

Post by Masa »

Ok, but I am also interested in non-volume attributes, such as pitch changing when an object gets farther or closer from you (the doppler effect, I believe). I know all the physics involved, i just need to know if theres already a sound format which uses physics equations. And yes, the 2nd option would be too slow for the game :cry: .
Manakel166

Post by Manakel166 »

I think you could use OpenAl sound engine , it's an api designed like opengl but for playing sounds located and oriented in 3D SPACE
Post Reply