0
私は、サウンド出力を確認して別の出力に切り替える(os.systemを使用して)簡単なスクリプトを書いています。ubuntuで外部コマンドを呼び出すPython 3.5のif文16.04
サウンド出力を確認するにはどうすればよいですか? 私が使用したい:
pacmd list cards | grep output\:
これが表示されているものです。
output:analog-stereo: Analogue Stereo Output (priority 6000, available: unknown)
output:analog-stereo+input:analog-stereo: Analogue Stereo Duplex (priority 6060, available: unknown)
output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: unknown)
output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analogue Stereo Input (priority 5460, available: unknown)
output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 300, available: unknown)
output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analogue Stereo Input (priority 360, available: unknown)
output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 300, available: unknown)
output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Analogue Stereo Input (priority 360, available: unknown)
output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5200, available: unknown)
output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analogue Stereo Input (priority 5260, available: unknown)
output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 100, available: unknown)
output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analogue Stereo Input (priority 160, available: unknown)
output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 100, available: unknown)
output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analogue Stereo Input (priority 160, available: unknown)
output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5200, available: unknown)
output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analogue Stereo Input (priority 5260, available: unknown)
output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 100, available: unknown)
output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analogue Stereo Input (priority 160, available: unknown)
output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 100, available: unknown)
output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analogue Stereo Input (priority 160, available: unknown)
active profile: <output:analog-stereo>
私はこのボトムライン「アクティブなプロファイル:」チェックするif文たい 何かあれば「などのアクティブなプロファイルを== analog-stereo: