25

这似乎根本不起作用:

cat /dev/urandom > /dev/dsp    #from wikipedia.org

是因为pulseaudio吗?或者我需要做一些设置?

4

3 回答 3

32

我不确定是否有一个简单的设备可以将字节发送到这些天 - 该/dev/dsp设备是一个旧的 OSS 东西,可能不会存在于现代基于 ALSA 的系统上,其中声卡由/dev/snd.

你可能最好使用aplay或“播放”数据,/dev/random尽管你可能需要给它一些开关来告诉它假设数据的格式。让它像 WAV 数据一样播放你想要类似的东西:

aplay -c 2 -f S16_LE -r 44100 /dev/random
于 2011-06-24T10:08:25.997 回答
12

pacat /dev/urandom
ubuntu无需任何额外安装即可 工作。

于 2017-04-06T10:50:56.130 回答
2
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | sed 1000000000q |aplay

cat /dev/urandom | tr -dc '0-9' | fold -w 10 | sed 1000000000q |aplay

cat /dev/urandom | tr -dc '0-9' | fold -w 10 | sed 1000000000q |aplay



cat /dev/urandom | tr -dc '&*(&(^)' | fold -w 10 | sed 1000000000q |aplay

cat /dev/urandom | tr -dc '&*(&(^)' | fold -w 10 | sed 1000000000q |aplay

cat /dev/urandom | tr -dc '~`!@#$%^&*()' | fold -w 1 | sed 1000000000q |aplay

cat /dev/urandom | tr -dc "0-9a-z" |aplay

cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 |aplay -r 192000
于 2016-12-08T16:15:45.167 回答