[ale] Generating sound

Jay Goodman ale at goody.homelinux.net
Mon May 7 15:34:46 EDT 2007


* this will create a 5 second wav file called "1k.wav"
sox -c 1 -r 44100 -s -w -t null /dev/null 1k.wav synth 5 sine create 1000

* quick and dirty mp3 conversion
lame 1k.wav 1k.mp3

* Alsa player (if alsa is used) to dump sound to speaker
aplay 1k.wav

Now, for reading in.  I have no speakers or mic at work to test, but I
know I used to be able to do a

cat /dev/dsp > input.raw

to get a raw unsigned 8bit mono dump and then use sox or lame to convert
it to a wav or mp3

It's a start, play around. :)





> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Okay, admittedly I'm new to using sound cards beyond playing alert sounds
> and
> hooking up speakers for video/audio playback.
>
> I need to generate a 1kHz tone and
>    a) emit this through a sound card to speakers
>    and b) convert this to an MP3 file.
> I can write a quick C program that will generate integer values in a
> sinusoidal
> fashion.  However, getting these values to a sound card is a mystery to me
> at
> this point.  Perhaps I'm thinking too low of a level - maybe the sound
> card will
> accept a command to generate a tone at a certain frequency.  Don't know.
>
> Additionally, I'll need to capture the A/D input from the line input jack.
>  I
> *don't* need to do both at the same time.
>
> If anyone could point me in a direction to get started, it'd be greatly
> appreciated.
>
> Thanks,
>     - Chuck
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGP2qJiR3HaLbYCa4RAlSHAJ9dow6pwIMlVvkvldio5hDu/bpaoACfe2oH
> ALhI7V7XwTzs5zmNg0qQZgk=
> =KQ/O
> -----END PGP SIGNATURE-----
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
>




More information about the Ale mailing list