I’m trying to play a tone with python using the following script referenced here:
http://forums.xkcd.com/viewtopic.php?f=11&t=49360
python -c "freq=220;sec=2;from math import sin,pi;rate=8000;w=
[chr(127+int(127*sin(i*2*pi*freq/rate))) for i in xrange(rate)]*sec;s=''.join(w);print s" >/dev/dspi in
xrange(rate)]*sec
I get a permission denied error
/dev/dsp: Permission denied
I am root and my user is a member of the audio group.
Is there something I am missing? I am using ubuntu 11.04
It’s because /dev/dsp was removed in ubuntu
Missing /dev/dsp under Ubuntu
Running these commands instead will work: