UNH1995:
Audio::Data on CPAN is probably a good place to start.
| [reply] |
To supplement HyperZonk's suggestion: in case you need to write some particular audio file format other than ".au" (which is what Audio::Data handles), you'll also want to look at Audio::Wav, Audio::SoundFile, maybe some others (just enter "audio" for the cpan module search).
But don't feel bad if these things aren't exactly what you need. There are also some nice tools written in C... (sox has probably been around the longest and can do the most, and the portions of its code that I've seen are reasonably well documented, so you can work out what's going on).
Frankly, I tend to prefer C for audio-related stuff: declare a buffer for short ints, fill it using a loop that implements some function, or by reading from a A/D converter, and write it to a disk file -- no muss, no fuss, and nothing very obscure. (Though I did recently use perl to validate/repair some mangled ms-wav file headers -- I'm getting better with the "pack" and "unpack" functions, and I was able to code it quicker than I could have in C; it's just that you need "pack" and "unpack" to do audio properly in Perl, and these calls tend to be hard to grok -- their descriptions in perlfunc are not an easy read.) | [reply] |
What class?
Check out my answer to Re: Win32 sound to file to audio CD and try out morsify ;)
BTW it's Perl , not PERL (not many people program in PERL).
| MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!" | | I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README). | | ** The third rule of perl club is a statement of fact: pod is sexy. |
| [reply] |