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

Hi, I have some interests in developing games as a hobby work. The current version of the perl(strawberry 5.012 win32) that I am using already has given me enough tool for all needed graphics job. But I am particularly having troubles on doing sound and gamepad related works. My question is would it be possible to communicate with the installed system's sound and gamepad related API using perl !WITHOUT! installing any additional CPAN modules? If not, I plan to use perl-to-SDL wrapper to get the job done. Just wanna make sure that there isn't an easier way before I jump into the SDL related stuff. Thank you in advance:)

Replies are listed 'Best First'.
Re: sound and gamepad support in Perl?
by Anonyrnous Monk (Hermit) on Jan 07, 2011 at 17:17 UTC
    ... !WITHOUT! installing any additional CPAN modules

    Perl doesn't have any sound- or gamepad-related builtins.  So, unless the respective API is accessible via files (or sockets), you'll have to use a module that interfaces with the APIs.

      OK. so..., the defualt perl doesn't provide any API for either sound output or gamepad inputs. It's hurting... Thanks for your reply.
        There is Audio:DSP for sound. And if you have a c application that takes commands on STDIN and simulates gamepad output, (like a keystroke interface simulator for the gamepad) you could run it thru Perl's IPC.

        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku ................... flash japh

        I've got the O'Reilly, "Perl Hacks" book by chromatic... in it, the one who contributed Hack #16 claims under the section "Animating with SDL Perl", and I quote (emphasis mine):

        "Add Sound and input handling, and you're (mostly) done! Sound is too easy to use to show here; input handling requires the proper monitoring of events reported by an instance of SDL::Event."

        It then goes on to give a couple sentences more on input handling, which I'm sure are helpful to someone...

        So there you have it... apparently sound was way too trivial to mention in the hack book... which means it should not be at all hard... cuz if it isn't well documented, it must mean that it's trivial.

        And, yes, I'm being sarcastic... rolling my eyes... and um... am just a bit jaded.

        Perl isn't a multimedia language without some... um... attachments...

        --Ray