mutefm icon indicating copy to clipboard operation
mutefm copied to clipboard

Spotify doesn't get paused, only muted (windows 10)

Open boboryan opened this issue 6 years ago • 23 comments

Since a few months, even when the "Stop if muted for too long" setting is enabled, spotify won't get paused, it plays fully muted in the background. It also doesn't get paused/stopped using the pause/stop buttons in mute.fm itself.

Looks as though they might have changed something on Spotify's end, and the assigned commands (spotify:pause, spotify:stop, etc) don't work anymore. There's zero information about these commands anywhere on the internet, and there are no documented or working command line options for Spotify which do the same.

Still, I managed to make it work by changing the "spotify:stop" command to a wscript command running my custom script placed in the syswow64, which presses a key combination which calls an autohotkey script which then finally can simulate a play/pause mediabutton push on the keyboard (which wscript cannot do).

So, mute.fm does indeed send the command assigned to stop the player, but the Spotify player doesnt't respond. Foobar on the other hand responds perfectly.

boboryan avatar Oct 24 '18 17:10 boboryan

There's zero information about these commands anywhere on the internet

spotify:pause, etc. are mute.fm's 'built-in' commands. Here is spotify:pause in code: https://github.com/jaredsohn/mutefm/blob/1050d2c40adc5e731e6cc72f18bdb2fb8cd45b69/src/shared/SmartVolManagerPackage/BgMusicManager.cs#L1337

Basically, this means that the built-in command will be broken for all mute.fm users; replacing it with a manual command is the right approach unless I update the code.

Updating the release is a bit of work since I would have to do some digging to find a computer that runs Windows (I'm a 100% Mac user now), so using custom scripts is probably the best option.

jaredsohn avatar Oct 24 '18 18:10 jaredsohn

@boboryan Is there any more information you can supply on this fix you found? Trying to fix this for my setup as well. Thanks.

neilmenon avatar Jan 22 '20 21:01 neilmenon

This is how i got it to work, eventually:

[image: image.png] You run a vbs script for the play and also the same script for the stop command. The script file must be placed in the SysWOW64 folder. This is what the script looks like:

Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.SendKeys "^%5"

Basically, this just sends altgr+5 to the system. Now, you need to configure AutoHotkey to intercept it, and assign it to the media play/pause button. The corresponding akh file looks like this:

^!5:: Send, {MEDIA_PLAY_PAUSE} Return

You need to setup AutoHotkey to run at startup, and to load the script. That's it basically. These are my timeout settings:

[image: image.png]

Hope I could help, happy listening!

On Wed, Jan 22, 2020 at 10:37 PM Neil Menon [email protected] wrote:

@boboryan https://github.com/boboryan Is there any more information you can supply on this fix you found? Trying to fix this for my setup as well. Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jaredsohn/mutefm/issues/8?email_source=notifications&email_token=AKTCWSVXL5L4XWOOJMIRQATQ7C4CTA5CNFSM4F7BYMZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJVGIHQ#issuecomment-577397790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKTCWSRL3KHWVQ6LMP3BJZTQ7C4CTANCNFSM4F7BYMZA .

boboryan avatar Jan 24 '20 16:01 boboryan

@jaredsohn Thank you for this awesome tool!

I've fixed this small bug. The window title changed from "SpotifyMainWindow" to "Chrome_WidgetWin_0". Now it works as intended.

You can download the working exe file from here: https://upld.de/f/bAG.rar Just replace the "mute_fm.exe" in "C:\Program Files (x86)\mute.fm" or wherever you installed it to.

LordDragonus avatar Feb 29 '20 01:02 LordDragonus

@LordDragonus works like a charm, thank you very much!

neilmenon avatar Feb 29 '20 03:02 neilmenon

@LordDragonus For me this is not working anymore on Windows 10. When I play music in chrome and Spotify fades out, Spotify does not fade back in but instead Chrome just starts playing again. Any idea how to fix this? I assume the window title changed again. Thanks!

neilmenon avatar Aug 17 '20 01:08 neilmenon

@neilmenon I guess Chrome is just using the same window title here. Spotify uses "Chrome_WidgetWin_0" which sounds like the Chrome Engine to me. I will try to fix this again.

LordDragonus avatar Aug 18 '20 16:08 LordDragonus

@LordDragonus having the same issue as neilmenon on Windows 10. Looking forward to the fix! Thank you.

Szktel avatar Jan 06 '21 12:01 Szktel

@neilmenon @Szktel Here is another fix: https://upld.de/f/bLo.rar Just replace the "mute_fm.exe" in "C:\Program Files (x86)\mute.fm" or wherever you installed it to.

LordDragonus avatar Jan 13 '21 02:01 LordDragonus

@LordDragonus just tested and it's not pausing. Tried restarting Spotify as well. I made sure to close the already running instance of mutefm.

neilmenon avatar Jan 13 '21 03:01 neilmenon

@neilmenon Please close mute.fm before replacing the mute_fm.exe. Then start the mute_fm.exe file directly. It should work without any problems. I've tested it with Chrome and Firefox and only Spotify plays again, as expected. Also check that you have enough rights to replace the mute_fm.exe and that there is no Antivir or Malware program blocking that action.

LordDragonus avatar Jan 13 '21 16:01 LordDragonus

@LordDragonus not working here either on my end. It's muting instead of pausing. Tried with Chrome and Edge.

Szktel avatar Jan 14 '21 00:01 Szktel

@neilmenon @Szktel I'm so sorry, yes, it doesn't pause spotify as it can't find the right window. It was sending the keys to one of the childs. I've reworked that part to find the parent window and send the keys to this window now. Hope this version will now work as intended: https://upld.de/f/bLx.rar Let me know please!

LordDragonus avatar Jan 14 '21 03:01 LordDragonus

@LordDragonus no problem, works perfectly, thanks a ton!

neilmenon avatar Jan 14 '21 04:01 neilmenon

@LordDragonus It's working perfectly now indeed, thank you!

Szktel avatar Jan 14 '21 05:01 Szktel

@LordDragonus Thank you! This is amazing and working perfectly with Spotify. Been watching this thread for months anxiously awaiting this. Anyway we can get a similar fix for PocketCasts?

BeanHax avatar Mar 23 '21 19:03 BeanHax

I've reworked that part to find the parent window and send the keys to this window now. Hope this version will now work as intended: upld.de/f/bLx.rar Let me know please!

thankyou its working 👍

Riztard avatar Feb 27 '22 13:02 Riztard

@LordDragonus can you reupload the fix? the link seems broken.

bhavmodi avatar Jun 27 '23 15:06 bhavmodi

@LordDragonus Can you contribute your changes, please? Not only is that link broken, people shouldn't have to do this at all. It should be incorporated in the official build.

BernierCR avatar Jul 01 '23 01:07 BernierCR

@LordDragonus bro can you reupload it the link got broken, thanks in advance

Singaram-117 avatar May 14 '24 11:05 Singaram-117

@Singaram-117 Sure! Here is the link: https://upld.de/f/bf1

LordDragonus avatar May 14 '24 13:05 LordDragonus

thank you very much buddy but i found another way short cut with a py script generated by chatgpt check this https://github.com/Singaram-117/python-scripts/blob/5a70b9ff180172074483f2a72654cd781d74f4c6/auto-pause-v1.py it justs checks the window name and pauses the spotify accordingly rather than waiting for sound source from any other application

Singaram-117 avatar May 16 '24 15:05 Singaram-117

@LordDragonus when I tried this one sent by you, I could use hotkeys to pause, play, and change tracks in Spotify successfully, the thing is

  1. the Spotify automatically pauses when YouTube video is played but after stopping it isn't resumed
  2. that too it works in Chrome alone not edge

I'm using Windows 11 in btw, I'm just saying this to improve the but if your busy nvm ;)

using hotkeys on spotify is itself a great thing !

Singaram-117 avatar May 18 '24 08:05 Singaram-117