Jump to content
  • Advertisement
Sign in to follow this  
ph33r

Simulating positional 3d sounds

This topic is 4345 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I’m trying to simulate positional 3d sounds. To do this I’ve been using two methods to give an OK approximation. Attenuation: Based on the distance the emitter is from the ear I attenuate the volume Pan: Based on the vector from the emitter to the ear, I use that ratio pan from the left and right speaker. This doesn’t help for sound emitters in front, behind, above and below. Does anyone know how to simulate those effects? -= Dave

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by ph33r
This doesn’t help for sound emitters in front, behind, above and below. Does anyone know how to simulate those effects?


Pretty sure the hardware can do this for you if you use a supported library like OpenGL.

Otherwise, I don't know. Perhaps you could just add extra fading for distance. To get more 3D sound with 2 speakers you'd likely have to know waaaaay more math about sound waves than I.

-me

Share this post


Link to post
Share on other sites
Quote:
Original post by Palidine
Pretty sure the hardware can do this for you if you use a supported library like OpenGL.

The API I'm using doesn't have support for playing 3d sounds.

Share this post


Link to post
Share on other sites
The listener should have a position, but also an orientation. Using the orientation (a rotation matrix), you can build 3 planes: XY, YZ, XZ.

I guess you could use those 3 planes to caracterize the relative position of the emitter to the listener and pan accordingly. I also guess you need a setup with more than 2 speakers, or you'll have to stick with L/R panning only.

You could also search about the pitch (by bending a channel) property of a sound and try to modulate it.

Share this post


Link to post
Share on other sites
Quote:
Original post by ph33r
The API I'm using doesn't have support for playing 3d sounds.


Alas. I have no answers then. You might want to switch APIs then. My hunch says it's very complicated math to actually make it sound right. dunno... maybe extra attenuation?

Consider a sound emitter movind in an arc in front of your face. At the point directly in front, it's going to be 1/2 the volume from each speaker as a full left or full right sound. I don't know actually that it gets more complicated than that unless you're using a 5.1 speaker system (in which case you need a better API anyway).

-me

Share this post


Link to post
Share on other sites
I'm sorry I didn't specify the constraints I'm working under.

- I don't have access to hardware support or another API. This means that using FMOD or OpenGL isn't an option.
- I have only two speakers to work with.

Share this post


Link to post
Share on other sites
Quote:
Original post by skalco6
You could also search about the pitch (by bending a channel) property of a sound and try to modulate it.


I'm not sure I understand what this would accomplish?


Share this post


Link to post
Share on other sites
I've simulated 3D sound on the Nintendo DS, so it's not always a matter of choice of API guys... The basic concept is simple, and the math is fairly easy.

From what I read on the web, the pitch is lower when the sound is far and getting higher as it pass you by. Think of a car...
I've not altered the pitch in our game, but I guess you could toy with it if you have enough time.

Share this post


Link to post
Share on other sites
Quote:
Original post by skalco6
I've simulated 3D sound on the Nintendo DS, so it's not always a matter of choice of API guys...

Cool, I'm working on the PSP :)

Quote:
From what I read on the web, the pitch is lower when the sound is far and getting higher as it pass you by. Think of a car...
I've not altered the pitch in our game, but I guess you could toy with it if you have enough time.

I've got positional distance from the ear already being calculated through attenuation but that doesn't help tell the direction the sound is comming from. It wouldn't help to tell if the sound was above or below you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!