Mary had a Little Camel
SubStack
created: 2006-09-04 15:32:49
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
created: 2006-09-05 04:24:34

Just Fun!

/me rofl

daniel
Re: Mary had a Little Camel
created: 2006-09-05 08:01:20
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".

I'm not really a human, but I play one on earth. Cogito ergo sum a bum
Re^2: Mary had a Little Camel
created: 2006-09-05 11:10:03
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
created: 2006-09-05 10:33:12
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
created: 2006-09-05 10:42:35
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.

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

perlmonks.org content © perlmonks.org and ruoso, SubStack, truedfx, zentara

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03