Re: [linux-audio-user] Digital audio files for hardware verification

From: Paul Winkler <pw_lists@email-addr-hidden>
Date: Tue Oct 25 2005 - 19:35:10 EEST

Awk is powerful and concise, but it's not my friend - I can never remember how
the heck it works ;-)

I'd probably do like Paul D. suggests and use existing tools - e.g.
find something
to generate an appropriate soundfile, then feed it through sox.
But just for fun, here's something silly I just whipped up:

$ ./sine_hex.py
Usage: ./sine_hex.py frequency [sampling rate] [bits]
Print one cycle of a sine wave of approximately the
given frequency.
Values given in hex with *bits* precision at *sampling rate*.
Default sampling rate is 44100. Default bits is 16.

pwinkler@email-addr-hidden-P-LT2K ~
$ ./sine_hex.py 24000 48000
0000
ffff

pwinkler@email-addr-hidden-P-LT2K ~
$ ./sine_hex.py 3000 48000
0000
31f1
61f7
8e39
b504
d4da
ec82
fb14
ffff
fb14
ec82
d4da
b504
8e39
61f7
31f1

And here's the source. Most of it is argument handling :-)
http://www.slinkp.com/~paul/sine_hex.py

--
http://www.slinkp.com
Received on Tue Oct 25 20:15:14 2005

This archive was generated by hypermail 2.1.8 : Tue Oct 25 2005 - 20:15:14 EEST