Flow.Launcher icon indicating copy to clipboard operation
Flow.Launcher copied to clipboard

Add Windows Media Player Warning

Open onesounds opened this issue 9 months ago • 9 comments

What's the PR

image

  • Fix https://github.com/Flow-Launcher/Flow.Launcher/issues/2682

  • If WMP doesn't exist on your system and can't adjust volume, it will warn and guide you beforehand.

  • Check if the executable of Windows Media Player(Legacy) exists by reading registry and turn it on/off.

    • Fallback to use SoundPlayer to play sound if there no WMP

More Info

  • After merging https://github.com/Flow-Launcher/Flow.Launcher/pull/2488, Multiple “sound not playing” issues reported
  • I investigated and found that these are users who have uninstalled WMP.
  • I looked into it and found that many people were uninstalling wmp. (Many posts offer this as a tip - the system warns you that there may be a problem, but many people ignore it)
    • soundplay() is not volume adjustable, and mediaplayer() is WMP-based, so it won't play without WMP.
    • I decided this was better than adding a library for WAV playback.
    • WMPlib is in system32 and there seems to be a way to utilize it, but I don't want to bother investigating further.

I am upset with the following situation 🤬

  • .NET uses WMP for sound play.
  • .NET doesn't provide a volume property for soundplay(). Who in the world decides not to put a volume property in a sound play function?
  • There are many posts telling people to delete WMP that is utilized in their system.
  • Despite the warnings on the system, people delete WMP.
  • We are the ones who suffer from all these problems.

onesounds avatar May 01 '24 22:05 onesounds

Would this be better?

"Windows Media Player is unavailable and is required for sound effects. Please check your installation."

Garulf avatar May 02 '24 17:05 Garulf

maybe try something like this https://github.com/mobiletechtracker/NetCoreAudio?

taooceros avatar May 03 '24 17:05 taooceros

Adding a new dependency to play a single sound sounds wrong to me.

Yusyuriv avatar May 03 '24 23:05 Yusyuriv

  • Change to use soundplay to play sound if there no WMP
  • Change the warning message to "Windows Media Player is unavailable and is required for volume adjust. Please check your WMP installation".
  • Warning is hidden by default. If there is no WMP, it will be visible.

onesounds avatar May 15 '24 14:05 onesounds

  • Add disable the volume control when without WMP
    • Disabled only the control, when it should have correctly output as disabling the entire card. Apply this after completing the SPLIT SETTINGS. (I don't know if there is a disable style)
  • Issue reporters have reported that this PR is working.

onesounds avatar May 16 '24 08:05 onesounds

@onesounds do you want to abstract this piece out to a usercontrol?

taooceros avatar May 17 '24 01:05 taooceros

I am going to enable squash and merge into one commit in case we need to get this out sooner.

jjw24 avatar May 17 '24 05:05 jjw24

@onesounds do you want to abstract this piece out to a usercontrol?

not now.

onesounds avatar May 17 '24 06:05 onesounds

Need to work on UI to match split setting pr. Will be worked on after split setting merge.

onesounds avatar May 22 '24 19:05 onesounds