1

I listen to music in my browser (be it Google Music, Spotify, Youtube, etc). Sometimes I need to quickly pause my music (e.g. when a colleague comes to my desk).

I do not have time to find the right browser tab and hit pause, so I currently lose my place in my music!

Is there a simple command I could run to pause all audio? I could assign it to a keyboard shortcut!

I've noticed that light-locker does exactly this! It pauses any audio when I lock my screen and carries on in the right place when I unlock. But I want to keep my screen unlocked when a colleague comes.

Any suggestions much appreciated - thank you!

  • Is there no mute button on your keyboard ? – Cyber_Star Mar 1 '17 at 12:47
  • But the audio would carry on playing so I'd lose my place! – Rich Mar 1 '17 at 12:54
  • How about suspending the pulseaudio process? That seems to work (other than a 1 second loop repeated). Just need a nice command to do it! – Rich Mar 1 '17 at 12:55
  • Oh Yes thats true sorry I'm not sure if i can help you out – Cyber_Star Mar 1 '17 at 12:55
0

Ok here's my best solution so far. Use this command to "pause" all audio:

/bin/bash -c "/usr/bin/amixer -q -D pulse sset Master mute; /usr/bin/killall -q -STOP 'pulseaudio'"

And use this command to "unpause" audio:

/bin/bash -c "/usr/bin/killall -q -CONT 'pulseaudio'; /usr/bin/amixer -q -D pulse sset Master unmute"

Use the Keyboard Settings to add these commands as application shortcuts (e.g. Super+Backspace to pause, Super+Enter to resume).

0

If you open your keyboard settings and go to the Shortcuts tab and then select Sound and Media you should be able to replace the Audio mute button for "Volume mute" to your desired key combination.

  • OP asked for audio to NOT continue playing while muted, so that it can be resumed seamlessly when eventually unmuted. – rackandboneman Sep 27 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.