Jump to content
The simFlight Network Forums

stop all sounds


Mr.Rick

Recommended Posts

5 minutes ago, Snupple said:

sound.play("paxsign.wav",0,-100)

That is playing with a volume of 100 on sound device 0 - but only when the FS has the focus. I haven't checked this (i.e. using negative numbers)....maybe it only plays when FSUIPC7 has the focus? Can you check this? And does it work with
    sound.play("paxsign.wav",0,100)
?

 

Link to comment
Share on other sites

28 minutes ago, John Dowson said:

That is playing with a volume of 100 on sound device 0 - but only when the FS has the focus. I haven't checked this (i.e. using negative numbers)....maybe it only plays when FSUIPC7 has the focus? Can you check this? And does it work with
    sound.play("paxsign.wav",0,100)
 

 

sound.play("paxsign.wav",0,100)   does work

Tried with -100 and it does only play when FSUIPC  has focus and  mutes when it looses focus,  in the manul it says refers to "FS" having focus, does that measn FSUIPC and not Flight Simulator?

 

Link to comment
Share on other sites

5 minutes ago, Snupple said:

Tried with -100 and it does only play when FSUIPC  has focus and  mutes when it looses focus,  in the manul it says refers to "FS" having focus, does that measn FSUIPC and not Flight Simulator?

At the moment, yes - but really its a bug, a hangover from FSUIPC6 which is an embedded dll, so the FS has the focus when FSUIPC has the focus. I will take a look at this an either restore the correct functionality (i.e. only play the sound if the FS has the focus) or remove this option - I don't think it worth keeping if it only plays when FSUIPC7 has the focus.

John

Link to comment
Share on other sites

I've just looked into this a bit further...it is not possible to restore this functionality completely, due to the change from an embedded process to a separate application. When using a non-negative number (i.e. 0-100), a windows flag is set when instructing windows to play the sound with "Global Focus", and this is not set when a negative number is used, and so it is windows itself that controls whether you hear the sound or not, but the sound file is played regardless. What this means if that if you play a sound using a negative number, the sound file is still played and if you change the focus to/from the FS then the sound will be played/muted as you change the focus.

Now that FSUIPC7 is a separate application, this is no longer possible. However, I could add a check on the existing focus, and if a negative number is used and the FS (or FSUIPC) does not have the focus, then I can just not play the sound file. The result would be similar but not identical, as it would be FSUIPC7 not playing the sound file, rather than windows playing the file and muting when the requested application does not have the focus.

Do you think this is still useful and worth implementing, or should I just remove this option?

Link to comment
Share on other sites

2 hours ago, John Dowson said:

Do you think this is still useful and worth implementing, or should I just remove this option?

I am going to remove this option, due to difficulties confirming whether MSFS actually has the focus or not. I will still allow negative values (for backwards compatibility) but they will be treated the same as positive values.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.