• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Play sounds

Messages
27
Country
us-newhampshire
Hello,

I would like to play sounds in the aircraft cabin from SimConnect. I found multiple references to XML_Sound.gau in google, but I was not able to locate the actual gauge files or xml files. I assume it is possible to create a gauge to which I can send events from my code using SimConnect and the gauge will play the sounds. Any suggestions for me on how to approach this problem?

Thank you.
 
After more searching, I did find the Freeware Sound Gauge - dsd_xml_sound3.gau by Doug Dawson. It was done in 2006 for FS9. And it seems that it plays sounds using DirectX calls. Does it mean that I would be better off playing sounds from my SimConnect application? I did not find a simple way of sending dsd_xml_sound_id_00 events to dsd_xml_sound3.gau. Am I missing something there?

Thanks.
 
I've not used Doug's software, but I managed to write a DirectSound handler in a C gauge to do it myself. However, there are limitations which I believe apply to Doug's solution also, mainly that through the SimConnect or other documented FS methods, you can't get the aircraft's distance or 3D aspect, so you wont know at what volume to play the sounds to match those in FSX. You also need to provide your own volume adjustments since (I don't believe) it's possible to tell what the current user set volume is in FS. (You could read the cfg, but that will only give the levels when FS starts and not any changed since.)

It also took me ages to write the code to manage the sound levels when the sim is stopped, in a dialog, paused, muted, etc.

Si
 
Thanks Simon853. I also decided to use my own wrapper. And you are so right about all the little things that come to play :). At least at this point I do not have to play sounds that require 3d position, so I do not have to deal with this issue... just yet.

Thanks a lot.
 
Here's a trick I learnt:

If there are sounds you only want to hear when you've a cockpit view selected, then you can trap on the View notification. This will immediately return the currect view (2D, Virtual Cockpit, or Orthogonal (External)). It will also send the view if the user changes it in the current window.

However... if there are more than one window open of different types, then it wont return the view state if the user switches window focus with a click of the mouse (FS then changes the sounds you hear accordingly.)

But... if you repeated subscribe and unsubscribe to the View event (say every 1/4 second), then it will continuously return the correct view state for the currently focused window and you can then play, mute, or attenuate your DirectSound sounds accordingy. :-)

Si
 
But... if you repeated subscribe and unsubscribe to the View event (say every 1/4 second), then it will continuously return the correct view state for the currently focused window and you can then play, mute, or attenuate your DirectSound sounds accordingy. :-)Si
That's a neat trick! Thanks.
 
Back
Top