3
Alternative phrasing: is there a commandline command to allow me to mute the speakers, and unmute them later. Ideally with the ability to fade-in. If I knew how to do that, I can work out how to tie it to a keyboard button. (I know my way around a bash script, but no very little about linux audio.)
The background to the question is that I'm often listening to internet radio (live or recorded) when the phone rings, so I hit mute on my keyboard. After the usually short call I get absorbed in my work and only realize 20 or 30 minutes later that everything is quiet and it has still been playing, but silently. So my idea is I'd hit the two minute mute button, then after two minutes it would come back; if I'm still on the phone I'll hit it again (or stop it properly).
It would also be perfect for when an annoying ad, trailer or traffic bulletin comes on :-)
UPDATE: The suggested answers worked perfectly. Here were how I wired it up to a special key on Ubuntu 10.04/Gnome:
- Created a file called /usr/local/bin/mute_for_120_seconds, with basically the below answer in it. Made executable.
- System | Preferences | Keyboard Shortcuts
- Click Add, Name: "mute_for_120_seconds", Command: "/usr/local/bin/mute_for_120_seconds"
- It appears under Custom Shortcuts. Click the shortcut column for it, then press the key combination I want to use.
- Close the keyboard shortcuts dialog and test the key.
(My dell notebook has a dedicated mute key. So, I've set AudioMute to be ctrl+XF86AudioMute, and then set my mute_for_120_seconds script to run with the mute key.)
Details: Ubuntu 10.04. Sound Preferences only tells me "Internal Audio, 1 Ouput/1 Input, Analog Stereo Duplex" Audacity's Help|audio Device Info has loads more to say, here is an extract:
==============================
Default capture device number: 8
Default playback device number: 8
==============================
...
==============================
Device ID: 8
Device name: ALSA: default
Input channels: 32
Output channels: 32
Low Input Latency: 0.011610
Low Output Latency: 0.011610
High Input Latency: 0.046440
High Output Latency: 0.046440
Supported Rates:
8000
9600
11025
12000
15000
16000
22050
24000
32000
44100
48000
88200
96000
192000
...
1Now plug the phone line back into the modem that (you never uses any more since getting broadband) and configure it to trigger the mute function. – Chris Nava – 2011-08-24T14:42:28.853
1Your next exercise is to do the fade out and fade in part. ;-) – Keith – 2011-08-25T03:20:34.800