Cant hear sound from "cat /dev/urandom > /dev/audio"
Hello,
I found this command somewhere which claims to produce sounds Quote:
Quote:
Quote:
Quote:
Quote:
Is the above command fake? Or I don't know to make it run?!? Kindly teach me if its so. |
cat /dev/urandom > /dev/audio
should produce an annoying random noise. I would think you have to be a member of the 'audio' group to do this (on my Debian Wheezy system anyway) When you submit a question, its probably a good idea to mention what Linux distro you're using(as the answer to your question could be very different depending on your distro) & perhaps some hardware details if relevant. If you 'ls -l ' the file you've been denied access to, it will tell you which user & group owns the file (or device like /dev/audio ) e.g. crw-rw----+ 1 root audio 14, 4 Jun 1 19:57 /dev/audio |
The issue is that you need to have root permissions to write directly to any of the /dev "files". Get to a root shell (or use sudo, if it's installed/configured, or if you're using Ubuntu :p), and then try the command.
What the command should do is produce white noise at an 8000 Hz sample rate. Make sure you turn your speakers way down before you do it, though…it's really loud. EDIT: Ninja'd. |
I am using Ubuntu 10.10
I supplied the above command from root but nothing happened. The prompt just went to the next line. Quote:
Why ain't working then ? |
I'm not too sure about the "cat /vmlinuz" version - I just tried it and it scrolled the binary down the screen accompanied by system beeps. I'd never heard of anyone using that command before.
However the "cat /dev/urandom > /dev/audio " version should as MrCode says, produce white noise. I presume your sound works OK for "normal" stuff, like playing music or YouTube etc. If it does, then you haven't got much to worry about on the audio front, believe me. The cat <file> >/dev/audio command plays *.au sound files I believe, but that type of sound file probably isn't even on your system. |
Quote:
EDIT: /vmlinuz should yield similar white noise (although it won't be perfect), as the kernel image is compressed, and hence the entropy is higher (it would probably be more interesting uncompressed ;))…did you remember to redirect output to /dev/audio or /dev/dsp? |
I thought so too, although /dev/urandom is the only version that produces white noise for me. I tried re-directing a wav file but that produced the same result as /vmlinuz did. I have got pulseaudio installed, though - to use the dsp device the sound file has to be processed by 'padsp' for example, so I'm not suprised at these results. As long as my 7.1 sound works OK I'm happy,anyway
|
All times are GMT -5. The time now is 10:23 AM. |