On Mon, Jul 7, 2008 at 2:24 PM, Octavian Rasnita <[EMAIL PROTECTED]> wrote: > From: "Jay Savage" <[EMAIL PROTECTED]> >> >> On Sun, Jul 6, 2008 at 4:37 AM, Octavian Rasnita <[EMAIL PROTECTED]> >> wrote: >>> >>> Hi, >>> >>> Does anyone know if there is a perl module that can be used for recording >>> in >>> .wav format? >>> (One that can be used under both Linux and Windows, or at least under >>> Windows.) >>> Thank you. >>> >>> Octavian >>> >> >> Recording what, exactly? An audio input device? A CD? System audio >> being played through the sound card? > > I need to be able to record from the microphone... something like what the > Windows Sound Recorder does. >
[snip] > > Ok, thank you. With other words... there is no module that can do what I > need unfortunately. :-( > But there are probably two. You are confusing three very different processes, here, and calling them all "recording." The first step is grabbing the raw data stream from your input device. If you can find an OSS-compatible device to use for recording, this is simple. If all you have is a proprietary audio subsystem to work with, this may be difficult (although it sounds like Win32::SoundRec may be a good place to start). The second step is taking the raw input stream from the audio device an saving it in the encoding of your choice. Several modules are available to this, depending on the audio libraries and codecs you have installed on your system (LAME, MAD, FFMpeg, etc.). Step three is editing and filtering the sound to make it sound the way you want. The Windows Sound Recorder recording sounds better to you because WSR is undoubtedly applying things like high-pass filtering and other noise reduction algorithms. Packages probably exist for filtering, as well. On Windows, though, your best bet may be to use Perl as a control structure for an external program, though, rather than trying to use Perl itself to do the heavy lifting. If you like the results from WSR, you should be able to control WSR using Win32::API. Another option would be to use a command-line batch processing application like SoX [http://sox.sourceforge.net/] to handle the recording and filtering, and using Perl to automate SoX through system(), IPC::Open*, Expect, etc. HTH, --j -------------------------------------------------- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org values of β will give rise to dom!