mutefm
mutefm copied to clipboard
Spotify doesn't get paused, only muted (windows 10)
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.
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.
@boboryan Is there any more information you can supply on this fix you found? Trying to fix this for my setup as well. Thanks.
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 .
@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 works like a charm, thank you very much!
@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 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 having the same issue as neilmenon on Windows 10. Looking forward to the fix! Thank you.
@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 just tested and it's not pausing. Tried restarting Spotify as well. I made sure to close the already running instance of mutefm.
@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 not working here either on my end. It's muting instead of pausing. Tried with Chrome and Edge.
@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 no problem, works perfectly, thanks a ton!
@LordDragonus It's working perfectly now indeed, thank you!
@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?
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 👍
@LordDragonus can you reupload the fix? the link seems broken.
@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.
@LordDragonus bro can you reupload it the link got broken, thanks in advance
@Singaram-117 Sure! Here is the link: https://upld.de/f/bf1
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
@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
- the Spotify automatically pauses when YouTube video is played but after stopping it isn't resumed
- 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 !