10

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

Emerson Hsieh
  • 6,850
  • 5
  • 38
  • 61
william teichner
  • 101
  • 1
  • 1
  • 3
  • 1
    It sounds like this question does not want to test that the speakers work, he wants to find out if the OS is currently playing any sound through them. Thus he doesn't want to play sound but to find out if any sound is currently playing. – thomasrutter Dec 13 '15 at 12:14

2 Answers2

32

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 had pressed Ctrl+Z keys to stop the testing.

MC ST0RMPEGASIS
  • 421
  • 4
  • 3
  • 3
    +1 because tested working in Xubuntu 14.04. This works well and there is no loud noise when running this command. –  Dec 13 '15 at 08:55
  • 1
    With -l, you can actually specify the loop count if you want it to stop after so many iterations, as in -l2. – abdus_salam Dec 10 '19 at 09:28
  • +1 as this allows to interactively stop playback with Ctrl+Z and it worked on [OpenMediaVault 5.5.12-1](http://openmediavault.org) out of the box when I connected via SSH for playback on an [Odroid Home Cloud 2](https://www.hardkernel.com/shop/odroid-hc2-home-cloud-two/) single board computer which has USB and an USB digital audio speaker attached. – porg Nov 26 '20 at 21:08
  • 1
    `CTRL+Z` stop and paced the job(speaker-test) in the bg (background). You can list the jobs stopped with `jobs` command. Actually you need to kill the job with, `CTRL+C` , It take many seconds. – christianbueno.1 May 03 '21 at 01:40
2

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

speaker-test
nims
  • 166
  • 4
  • yeah and for more info you can use this http://manpages.ubuntu.com/manpages/natty/man1/speaker-test.1.html – Raja G Jun 09 '12 at 03:32
  • OP said `speaker-test` is too noise for him in duplicate question which should be closed soon. Alternatives? – ish Jun 09 '12 at 23:11