teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

情報元のさらに情報元が見つかったのでご紹介します

2021/11/05 12:36

投稿

PROoJI3
PROoJI3

スコア9

answer CHANGED
@@ -25,4 +25,25 @@
25
25
  pacmd set-source-volume < index > 0x8000
26
26
  # < index >はそれぞれ機器による
27
27
  ```
28
- とすることでうまくいきました。
28
+ とすることでうまくいきました。
29
+
30
+ ---
31
+ **追加情報**
32
+ 上記ご紹介しましたwebサイトの元ネタは以下の WebSite のようです。
33
+ [How can I change the default audio device from command line?](https://askubuntu.com/questions/14077/how-can-i-change-the-default-audio-device-from-command-line)
34
+ Ubuntu's desktop gui is great for changing audio settings (System->Preferences->Sound), like the default input/output device and setting the volume.
35
+
36
+ However, I would like to be able to do these things from the command-line. What tool is the gui using behind the scenes?
37
+ **Answer**
38
+ You can control PulseAudio thoroughly through the command line using pacmd and pactl commands. For options see pacmd --help or the wiki at PulseAudio:
39
+ ```shell
40
+ pacmd list-sinks for name or index number of possible sinks
41
+
42
+ pacmd list-sources for name or index number of possible sources
43
+
44
+ pacmd set-default-sink "SINKNAME" | index to set the default output sink
45
+
46
+ pacmd set-default-source "SOURCENAME" | index to set the default input
47
+
48
+ pacmd set-sink-volume index volume
49
+ ```