1

It used to be that if you wanted to test your sound you could simply cat any file to /dev/snd, but that doesn't appear to work on any of the systems (Debian/Ubuntu/Mint, Arch) that I've tried.

From what I've read, this can be any kind of file - text, pdf, whatever. And if it's a .wav file then it will actually play music.

So how can you do the same thing on modern systems (e.g. ones using pulse audio & other drivers)

2

From my testing, aplay works:

aplay <filename>

When I did

aplay test.html   # a simple html file

I got hissy static.

aplay something.wav

Played the music in the wav file. And in a bizarre twist, a file containing this:

Fri Jan 13 08:20:01 CST 2012
Fri Jan 13 08:21:01 CST 2012
Fri Jan 13 08:22:01 CST 2012
Fri Jan 13 08:23:01 CST 2012
Fri Jan 13 08:24:01 CST 2012
Fri Jan 13 08:25:01 CST 2012
Fri Jan 13 08:26:01 CST 2012
Fri Jan 13 08:27:01 CST 2012
Fri Jan 13 08:28:01 CST 2012
Fri Jan 13 08:29:01 CST 2012
Fri Jan 13 08:30:01 CST 2012
Fri Jan 13 08:31:01 CST 2012
Fri Jan 13 08:32:01 CST 2012
Fri Jan 13 08:33:01 CST 2012

Makes a gentle "beep"

2

If your goal is specifically to pipe arbitrary data from a file to your sound card then your solution is solid.

If your goal is simply to test that your sound works then I would recommend the command speaker-test. It plays static over a single channel by default. On Debian based systems it comes from the alsa-utils package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.