perl -e'%c=map{[a..z]->[log($_)/log(2)*8-48],$_}map 2**($_/8),6*8..8*8; print((((chr)x($_/16)).("\x00"x(256-$_)/16))x128)for map{$c{$_},0}"jklkjjj0kkk0j0g0g00jklkjjjjkkjkl"=~/./g'>>/dev/dsp
Optionally, adjust x128 to make it play faster or slower.
(Thanks to tybalt89 on freenode for the =~/./g suggestion)
Re: Mary had a Little Camel
Re: Mary had a Little Camel
Could you say what the format and bitrate is for this audio? I get static, because without an initialization, my sblive will play audio at "Unsigned 8 bit, Rate 8000 Hz, Mono".
Re^2: Mary had a Little Camel
After grepping around a bit through the alsa source for my sound card, I found a section that says the default sample rate is 44100 for dsp (dsp_spos_scb_lib.c). However, playing around with aplay, as others have suggested,-r 8000 produces identical output to piping to dsp on this machine.
Re: Mary had a Little Camel
Instead of
>>/dev/dsp, you can also try
|aplay (or a similar program). I have no
/dev/dsp, so I needed that to hear anything. That said, it's pretty neat, and maybe you could do a morse JAPH? :)
Re^2: Mary had a Little Camel
Yeah, I got sound with " | aplay -f S16_LE -c1 -r 8000 -t raw" , but it wasn't like 'Mary had a little lamb'. If anyone knows better settings, let me know.