-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

dinhtrung wrote:
> You can use Audacity, with LADSPA effect. It has the Generate menu,
> which can help you generate sine, triangle or square wave. Even DTMF
> Tones! And it's a GTK application, so don't bother read command line.
> You can generate the waveform, and then save it to a file, and play back
> anytime you like. Remember you have to EXPORT the project into a well
> known format, rather than SAVE the project with .aup format: other
> programs won't read it.

Thank you Trung for pointing that one out. Turns out that wav file
format is very simple [1]. After the post, I've already written a piece
of code to do just what I need. It takes in a list of frequencies and
output the needed wave form in a 1 second wav file.

Like this:

gensine 1000 > 1000.wav
generates 1s 1000Hz tone.

gensine 770 1209 > dtmf-4.wav
generates 1s number 4 DTMF.


[1] http://technology.niagarac.on.ca/courses/ctec1631/WavFileFormat.html

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFItPpzsQKAZYrNOIIRAlHfAJ95bFnpSzZ0Ko6fNJH0XofgLSNPlgCgk6V/
8vvpzCXKzGSlS/Ej2rqis8g=
=VT+w
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gensine.c
Type: text/x-csrc
Size: 2456 bytes
Desc: not available
Url : 
http://lists.hanoilug.org/pipermail/hanoilug/attachments/20080827/8e6229f7/attachment.c
 

Trả lời cho