   3d positional sound
  Hey Guys,For fun i'm trying to implent 3d positional sound into a game i'm working on.  I have a neat sounding effect that sounds positional but i'm not sure how to control it.What i do is this...1) I have the same sound playing on the left and right channels2) I set the volume on the left side to be based on sin of the current ticks3) I set the volume on the right side to be based on the cos of the current ticksit sounds like the sound is moving to the left, around the back of my head, then comes around from the right and goes to being in front of me again.It's kind of neat and works well, but is this how positional sound is usually done?to make this work to sound like it was coming from a specific point offset from the player would i take the sin and cos of the vector to that point and apply that instead of the sin and cos of the current ticks?Thanks!   
  this is quoting my friend from an email he sent me about holophonic sound on the GPU. I haven't gotten to it yet, but here is some advice.Quote:If by 'Holophonic' sound you mean Psychoacoustic audio (that is just the name I knew it by, Holophonic may be more appropriate) than I do know a couple of tricks.What I know of the Psychoacoustics is also referred to as 'virtual surround sound' or even '3D' surround sound. It basically comes down to adjusting the two stereo audio channels to effect the way the brain processes and perceives the sound.The parameters of the channels that are normally adjusted are the intensity, phase shift and (to a lesser extent) EQ'ing. Just adjusting the relative levels of the two stereo channels is basically just a 'fade' but can do a fair amount to fool the brain into thinking that sound is moving from one location to the other along the left right axis.You can also apply a phase shift to the two channels. I don't remember exactly what this does, but i think it can 'magnify' the perception of angular localization. This is covered briefly at the end of this PDF:http://www.billbuxton.com/AudioUI02acoustics.pdfand in this google books result:http://books.google.com/books?id=yk65nb2XBREC&lpg=PA100&ots=3Qh97y7DJw&dq=psychoacoustics%20phase%20shift%20localization&pg=PA97#v=onepage&q=&f=falseCombining angular and left right 'pan' localaization can 'throw' the sound further forward (or backwards, but I can't remember how to flip the sound into the back plane).;  Thanks for the info, interesting read (:   ;Quote:It's kind of neat and works well, but is this how positional sound is usually done?Just want to note that there are (free) sound libraries like OpenAL around which handels 3d positional sound for you (... if you don't know already :) ).--Ashaman;  Thanks, I do.  I was just wondering about how the technique is actually programmed (:   ;Quote:Original post by Ashaman73Quote:It's kind of neat and works well, but is this how positional sound is usually done?Just want to note that there are (free) sound libraries like OpenAL around which handels 3d positional sound for you (... if you don't know already :) ).--AshamanNot for 2 channels though (headphones). Making a sound 3D in a 2 channel environment requires some additional effects. That is what the email above was referring to. I dont think OpenAL supports that.   ;  Your brain is able to recognize the approximate source of sound due to how the propogation paths differ to each ear. The sound is "changed" on its way to each ear canal by the environment, your head, and the shape of your outer and inner ear. Using a moderately sophisticated setup, one can transmit an audio impulse at a known location relative to the head and measure the sound received at each ear. This can give you an approximation of the transfer function of the propagation path for each ear. Unfortunately this also includes factors such as the transmit equipment, receive equipment, and the specific environment of the test, but those can be approximated as well and removed. What you are left with is a set of filters (one per ear per direction) that can be applied to raw audio that will make the sound appear directional. The effect works best with headphones, otherwise you need to account for how the sound will change from speaks to the listener. You can usually get something close enough for it to sound pretty good in many cases, though.Since the measurements can be fit to linear filters, this is essentially a set of rules for how to phase shift and scale each frequency component as another reply mentioned. You can probably find a set of ready-to-use filters via google. I know MIT published some of their research data awhile back (in raw form). Really quite interesting stuff...More info (wikipedia)   ;Quote:Original post by save yourselfYou can probably find a set of ready-to-use filters via google. I know MIT published some of their research data awhile back (in raw form). Really quite interesting stuff...The "ready-to-use filters" is exactly what i have been looking/waiting for. The MIT stuff is just papers right?Im not entirely familiar with the DSP process. But i eventually hope to find out enough info to put it into a CUDA app or something.From what i read on those papers, good lord is it complicated. Especially when they talk about rain hitting leaves, and pumping multiple localized sounds through those algorithms. I think that is from the same paper...;  I was thinking about something similar; making a DSP program work with Larabee when it comes out.I'm just wondering if the transfer rate from CPU to GPU (/larabee) and then back and into the sound card may just be too far to travel for real time processing.maybe offline processing it would work like a champ but ::shrug::   ;  If the goal here is the result, there might be sorter paths. I am not very familiar with audio APIs such as DirectSound, but you might research using DirectSound3d and support more advanced processing when it can be offloaded to a capable audio card. In general, the problem with the various audio localization techniques used is that they leave much to be desired, especially when coming out of stereo speakers. It is a lot to go through when you could see much better results from focusing that time on creating some immersive audio environments that require 5.1 or 7.1 systems. It would probably appeal to more gamers than saying you have amazing stereo audio with fully simulated 3d environments (but only if you happen to have good quality headphones).That being said, mentioning CUDA/Larabee suggests that you have a more acedemic interest in the subject. Although I'm not convinced that you need that kind of horsepower to get good results, it would be nice to see some good audio demos with complex environments creating all sorts of effects from many sources in real-time. The MIT data I mentioned is the KEMAR dummy head data that has been used for mainly for research. You will probably need MATLAB (or Octave, something equivalent) to process the data into something usable. Maybe somebody else has already done this and made it public? There is also some interesting stuff here, including some visualizations of how all this stuff actually works.   