Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select the output device of audio in ubuntu manually?

Tags:

linux

ubuntu

In Ubuntu, we can select the output device of audio in sound preferences. But now I want to write a shell script, so I need to select the output device from the commandline.

like image 477
user749816 Avatar asked May 12 '11 03:05

user749816


1 Answers

You can first view your current default audio device by typing:

pactl stat 

And with

pactl list

you can view all your devices.

And with this command

echo "set-default-sink alsa_output.Headset" | pacmd

you can set the default device.

But I found a much better source for this problem and a included little shell script for this problem here http://ubuntuforums.org/archive/index.php/t-1370383.html

like image 179
Tobias Avatar answered Sep 22 '22 16:09

Tobias