4

How can I mute alerts on Ubuntu Precise on the command line, like in System settings > Sound > Sound effects?

2 Answers2

3

If you're just trying to mute audio, this should work on most modern Ubuntu distros:

amixer set Master mute

Of course, YMMV with older distros or custom sound setups.

Update: (for event sounds only)

I don't have an Ubuntu 12.04 LiveCD handy to test, but on 16.04 you can use gsettings to disable just the event-sounds key like so:

gsettings set org.gnome.desktop.sound event-sounds false

Note: That only applies the settings for the current user.

The core settings haven't changed much over the past few years, so it may do what you need. Run the command with true to re-enable event sounds.

gsettings is just a wrapper for dconf, so if you want graphical state verification, you can sudo apt-get install dconf-editor. Running dconf-editor will give you a GUI to manage a number of higher-level system settings. Use the left dropdown list to navigate to org > gnome > desktop > sound to find the event-sounds option.

  • Not muting audio altogether, but muting the annoying sound effects like feedback when adjusting the volume, the terminal bell etc. See this screenshot: http://i.stack.imgur.com/DgndP.png – Joó Ádám Sep 11 '16 at 18:00
  • Updated to disable event-sounds only. – codewithmichael Sep 11 '16 at 18:50
  • Thanks. Unfortunately, that key must be responsible for something else, since setting the preference from the GUI has no effect on the dconf setting. Actually, I just diffed the output of gsettings list-recursively before and after changing the setting and there’s no difference whatsoever. What I have found though, is that ~/.pulse/097d18fb4ffdc9214b29c17d0000000f-stream-volumes.tdb does change when I change the setting on the GUI, but I know nothing about those files. – Joó Ádám Sep 11 '16 at 19:19
  • event-sounds is sort of a blanket meta setting. Adjusting individual sound effect settings in the Gnome settings window provides a subset adjustment. From past experience, setting event-sounds to false entirely disables the individual sound settings section in the Gnome sound settings window (along with disabling the notification sounds themselves). Unfortunately, I don't know any console commands to affect the sound effects individually. I do know the ~/.pulse/*.tdb files control PulseAudio-specific settings on a per-user basis, but that's all I know on that one. – codewithmichael Sep 11 '16 at 19:39
  • By the way, did you actually test to see if the notification sounds were muted after running the gsettings command (aside from what the settings window says)? – codewithmichael Sep 11 '16 at 19:42
  • I didn’t, because I remember I already checked that earlier. However, now I tried it again, and it does mute the terminal bell, but it leaves the effect of changing the sound volume intact. These are the two effects I’m aware of muted when I use the GUI. – Joó Ádám Sep 11 '16 at 19:52
  • Hmm, it also mutes those sounds for me on 16.04. You may want to consider moving this over to [ubuntu.se] to find a more specific answer. Since Ubuntu 12.04 is 2 full LTS releases back at this point, this is a fairly point-in-time-distro-specific question. – codewithmichael Sep 11 '16 at 20:29
0

Old thread, but since I encountered the same issue on debian I thought I'd tell what I found as a close solution.

I'd live boot into a clean iso of the distro and open the System settings > Sound > Sound effects and turn these sounds off as I preferred, then I'd copy the file ~/.config/pulse/*-stream-volumes.tdb and save it on my hard drive. Then whenever I'd need to turn off the "sound effects" on an installed environment or while building a custom version of the distro I'd cp saved-pulse-volumes.tdb ~/.config/pulse/*-stream-volumes.tdb. This worked like a charm for me.

Note: In the time of this answer, the dconf key: org.gnome.desktop.sound event-sounds didn't turn off the slider volume sound effect, at least not in debian.