shlomif / PySolFC

A comprehensive, feature-rich, open source, and portable, collection of Solitaire games.
http://pysolfc.sourceforge.net/
GNU General Public License v3.0
463 stars 105 forks source link

Sound stays turned off #393

Open hajo4 opened 1 month ago

hajo4 commented 1 month ago

I recently got a speaker that is connected via USB, and has a switch to turn it on/off.

Pysol, (among some other programs) turn their sound off when this speaker is off, but dont turn sound on again when speaker gets on again. Ie. those programs need to be restarted to play sounds again. I guess they only check once at startup if they can play sounds...

Some other programs (like firefox) have no such problems.

joeraz commented 1 month ago

From a technical perspective, this is because PySol needs to detect which sound component is installed, if any (i.e. pysol-sound-server or pygame), and adjust the audio settings appropriately. It doesn't usually expect the audio component to be switched out while running (as you can't delete files in use).

hajo4 commented 1 month ago

I suggest to re-check the sound component at certain points while the program is running, eg. when starting a game, or when un/pausing.