munawarb / Three-D-Velocity

a fighter jet flight Simulator for the blind and visually Impaired
GNU Affero General Public License v3.0
24 stars 18 forks source link

3D sound issue on Windows 7 since the move to XAudio2 #118

Closed obert01 closed 2 years ago

obert01 commented 4 years ago

Dear all,

A few friends of mine have reported that, since the move to XAudio2, 3D sound is not properly rendered on Windows7. More precisely, all positional sounds are placed in the left ear instead of being properly panned. Musics and cut scenes are not affected by the issue.

I finally configured a Windows 7 VM on my Windows 10 computer and can confirm the issue.

I have cloned the repository, I am able to compile the source code. I am not extremely experimented with C#, but sufficiently in general programming to make some modifications and some tests.

The issue could be related to the way X3DAudio is initialized (number of speakers, speaker model, ...). Maybe a special case should be made for Windows 7.

Have you any idea for something I could try? Is someone encountering the same problem?

Of course, I know Windows 7 is not supported anymore, which I told my friends. ^^

obert01 commented 4 years ago

OK I've found the issue.

The problem is that mainMasteringVoice.ChannelMask returns 0 if XAudio version is less than 2.8. On Windows 7, with the latest Direct X update (2010 ... lol), XAudio is in version 2.7.

We have two choices:

munawarb commented 4 years ago

Hi @obert01, Thanks for your comments and for actively looking into the issue! You're tempting me to install Visual Studio here so I can compile this and put it up. :) I'll take a look at your pull request soon and merge it. Great work!