rawnar Posted September 6, 2010 Share Posted September 6, 2010 While slicer is working on a new implementation for positional audio I would like to share my ideas with the rest.One of the main problems, with how positional audio is implemented at the moment, is that when you have a speaker configuration that is mainly positioned in front of you also the sound from the front will be harder then from the back. This topic will give information about the problem and the terms used here. One of my ideas was to shift the listener to the centre of mass of the speakers. The effect of this is that the sum of the dot products between the speakers and the source direction vector will be zero. And this is what we want, as it will result in that the total volume over all the speakers will be independent to the direction of the source. This can also be implemented without putting extra load in the CPU during use, as the shift of the speaker only has to be performed ones. We still have to be careful that the sub woofer does not mess up the system, we just need to leave it out of the centre of mass calculations and the corresponding shift. One problem with this system is that the dot product can be larger then 1.0.The previous idea also showed me that the overall volume is reduced when switching to positional audio. In a no positional audio case all the speakers will have a volume of 1.0, so the total volume is the amount of speakers. In the positional audio case, even when one has a nice even distribution of speakers, the total volume will be the amount of speakers divided by 2. In the gain calculation first 1 is added to the dot product after which it is divided by 2, so if the sum of dot is zero then the sum of the gain will be the amount of speakers divided by 2. An easy fix for this would be, when not in positional audio divided the volume of the speakers by 2. But this can cause that mumble will sound soft with respect to other sound programs.Lets take a look at the implementation slicer is suggesting. His idea is to find the speakers between which the sound source is coming from. And use the ratio between the angles of the source vector and these speakers vectors to distribute the sound volume. This will give a nice distribution of the sound over any array of speakers. The only thing I am worrying about is that now the total volume will be 1, so with a large amount of speakers the difference between positional audio volume and normal volume will be quick large.There was also a discussion about the attenuation with distance on the irc channel, so I also had a deeper peek into these formula's. If we have a look in the OpenAL source code you will find that they have three different distance models. These models all are dependent on a reference distance (dis_ref) and a Roll-off factor(Rolloff). The reference distance can be seen as the minimal distance (dis_min) used in mumble and the Roll-off factor gives how fast the sound gets softer with distance. In mumble the Roll-off factor is not given, but is implicitly calculated with the use of maximum distance (dis_max) and volume at maximum distance (A_max). The three models are as follows.Inverse distance model: (proposed in IASIG I3DL2)A = dis_ref / ( dis_ref + Rolloff * ( dis - dis_ref ) )Linear distance model: previous implemented in mumbleA = 1 - Rolloff * ( dis - dis_ref ) / ( dis_max - dis_ref )Exponential distance model:A = ( dis / dis_ref ) ^ ( -Rolloff )If one calculates the Roll-off factor using the maximum distance and the volume at maximum distance and fills it back into the formulas you will get,inverse: A = 1 / ( 1 + ( 1 - A_max ) / A_max * ( dis - dis_min ) / ( dis_max - dis_min ) )linear: A = 1 - ( 1 - A_max) * ( dis - dis_min ) / ( dis_max - dis_min )exponential: A = ( dis / dis_min ) ^ ( ln(A_max) / ( ln(dis_max) - ln(dis_min) ) ) = e ^ ( ln(A_max) * ( ln(dis) - ln(dis_min) ) / ( ln(dis_max) - ln(dis_min) ) )Within mumble a modified version of the exponential distance model is used.A = 10 ^ ( log10(A_max) * ( dis - dis_min ) / ( dis_max - dis_min ) )Let see how these three models will behave in mumble, using minimal distance = 1, maximum distance = 20, volume at maximum distance = 0.2.http://www.plaatjesupload.nl/bekijk/2010/09/06/1283791438-590.gifSo which one is the one we want. I do not know, do you have a preference? Computer specs: AMD FX-8320, 8GB DDR3-SDRAM, AMD Radeon HD 7950, Asus Xonar D1, Windows 7 Ultimate 64bit/Debian Jessie AMD64. Link to comment Share on other sites More sharing options...
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now