deadkarma has asked for the wisdom of the Perl Monks concerning the following question:

There was an article in The Perl Journal about creating an IP telephone in 74 lines of perl:
http://www.samag.com/documents/s=1272/sam05030002/

I was considering expanding this code to include a nice GUI (either with Tk, Win32::GUI, or maybe even Wx),the problem that I am faced with now is how the heck can perl grab data from a microphone under Windows?

I'm thinking it might be neccesary to use Win32::API and do some funky dll calls, but I'm not familiar with the Windows API.

Is there a magic microphone device in windows like LPT1 and COM1?

I imagine that might not be too difficult to write a stand-alone exe that can open the mic and stream wav data, that way perl can do a nice open(MIC, "| mic.exe")

Replies are listed 'Best First'.
Re: recording sound with perl under win32?
by cheshirecat (Sexton) on Oct 14, 2002 at 15:31 UTC
    You could take a look at Win32::Multimedia which uses the MCI api
    Which is microsofts general purpose interface to multimedia devices from cds to vcrs !

    While you are at it, you'll probably want to look at Audio::Wav and Win32::Sound
    Enjoy
    The Cat
Win32::SoundRec for Re: recording sound with perl under win32?
by elwarren (Priest) on Sep 29, 2003 at 15:45 UTC
    Looking for similar info, I stumbled across Win32::SoundRec today.

    Nearly a year later, did you ever make any progress with this project? I remember reading the same article and thinking it would be a neat project.

    Now, does anyone know how hard it would be to implement this on the Perl PocketPC WinCE platform?
      I haven't really done much since I couldn't find a proper way of accessing the mic, and didn't want to bother with Windows API calls.

      Thanks for the info, I'll check out that module, maybe I'll actually finish it :)

      I didn't even know perl was ported to the PocketPC.
      Since Win32::SoundRec uses 'winmm.dll', I don't think it would work on PocketPC... but I could be wrong.

        Yep, you can find PerlCE 5.6.x at this site. I haven't played with it in awhile, but it does have Win32::API, Win32::OLE, and some other modules ported. I think Win32::Sound and SoundRec are essentially just calls to Win32::API, but I haven't investigated beyond that.

        It looks as if the PerlCE port has some new life. You can find PerlCE 5.8.x up on PerlCE.sourceforge.net.

        I ran out of space on my ipaq, so perl was one of the first toys that had to go :( Anyone want to buy an ipaq3635 so I can buy a new ipaq5450?