Running 'cat /dev/urandom > /dev/audio' does nothing

1

I am trying to have some fun by playing some random audio using /dev/audio under Ubuntu 17.10. The command cat /dev/urandom > /dev/audio executes successfully but it outputs absolutely nothing to my default speaker. What is wrong here? Thanks...

UPDATE: after waiting a while, it says 'no space left on device'

Safal Aryal

Posted 2017-12-21T11:39:16.203

Reputation: 13

Answers

3

There was no special file /dev/audio. You have created a regular file and run out of space.

I think /dev/audio is an interface of OSS. Ubuntu uses Pulseaudio instead.

Kamil Maciorowski

Posted 2017-12-21T11:39:16.203

Reputation: 38 429

2

Has been anwsered on SO: How to pipe /dev/urandom to linux sound output? Basically:

aplay -c 2 -f S16_LE -r 44100 /dev/random

flowtron

Posted 2017-12-21T11:39:16.203

Reputation: 352

1FYI, -f cd is a shortcut for (16 bit little endian, 44100, stereo) [-f S16_LE -c2 -r44100] And random could (would?) block, urandom's better for this sort of non-essential randomness (crypto/LUKS output would be even better, maybe sound different though) Does it sound as bad as it... sounds like it would? – Xen2050 – 2017-12-22T02:14:45.600