Depending on the situation, I use either my speakers or my headset for audio output. Given that my headset is an USB headset it behaves as its own audio device.
Currently I switch between audio output devices by clicking on the speaker icon in the upper right tray, where I select Sound settings, goes to the Output tab and there choses the device I want.
What I wonder is if there might be some easier/quicker way to switch back and forth to my USB headset? Perhaps a dedicated tray icon, a key mapping, or so?
I am running Ubuntu 10.04, with the default Gnome desktop.
Best Answer
In order to change the default audio output device from the command line, you can use the
pacmd
Pulse Audio command-line utility.I found the need to do similarly today, wanting to switch between headphones and speakers, both plugged into separate audio cards. Here's the shell script I wrote to do so:
Notes:
pacmd
utility lists. If you have more than two audio devices and want to swap to a different one, you'll need to replace the logic on line 7 with some conditionals.