17

Which bash command will indicate the sound output speaker(output or no output), so I can reset my web radio when it crashes?

4 Answers4

43

This is a really good command testing out all speakers.

speaker-test -t wav -c 6

Remarks on usage

There is no loud noise heard when running this command, except a voice saying "front left, front center, front right...". This command will continue to repeat the testing, until the user presses Ctrl+c keys to stop the testing.

A B
  • 1,466
4

To test a two channel (left and right) setup, this plays a voice saying "front left", "front right", then exits:

speaker-test -t wav -c 2 -l 1

For a surround sound setup, set -c to as many channels as you have:

speaker-test -t wav -c 6 -l 1

Meaning of the options:

  • -t,--test wav play a voice instead of static/noise
  • -l,--nloops 1 test only once
  • -c,--channels number of output channels to test
A B
  • 1,466
3

Assuming that all you want is to check if the there is an output on the speaker, Use

speaker-test
nims
  • 176
0

If you want it to exit even faster, set both voice output (-t wav) and one loop (-l 1):

speaker-test -t wav -l 1

On my setup, it defaults to one channel (-c 1), so this just speaks "front left" once and then exits.

krubo
  • 951