Generate white noise
Bash, 34
dd if=/dev/sda of=file.wav count=1
If you don't want hard drive 'randomness', (a lot slower)
dd if=/dev/random of=file.wav count=9
SPIN, 28
word x=0
repeat
word[?x]=?x
Bash + ALSA, score:44 (52 chars - (10% + 5%) bonuses)
Longer than the other bash
answer, but accepts duration and bitrate. Also adds a reasonably correct header to the file, so should be reasonably portable:
arecord -r$2|head -c44;head -c$[$2*$1] /dev/urandom
Save as a script, chmod +x
it and run:
$ ./wav.sh 1 44100 > c.wav
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 44100 Hz, Mono
$
Note, .wav output is to stdout, so it must be redirected to a file.
Mathematica 52 - 5 = 47
g
exports a white noise .wav file of s
seconds and 8000 bps.
g@s_:=Export["p.wav",RandomReal@{-1,1}~Play~{t,0,s}]
Example: a 6 second white noise file is exported.
g[6]
p.wav