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

Hi fellow Monks. I have been tirelessly trying to figure out how to get Perl to play wav files when people visit my web site like what you can do with HTML. There are a couple of problems though, I am using Red Hat 9.0 and Apache 2.0 for my web server, and (1)I have no idea what module to download and install and (2) I am not positive about the code usage. I Googled this issue and didn't find much other than to try using use Audio::Wav; but of course the correct module was not installed. I tried downloading the module and installing, but I must have got the wrong module. Do any of my fellow monks have any ideas how to resolve this issue?

Replies are listed 'Best First'.
Re: Sound Functionality With Perl
by Joost (Canon) on Apr 10, 2005 at 02:18 UTC
    basically, perl has nothing to do with playing wav files in a browser. The browser decides whether to (not to) play audio files. AFAIK there are no official tags *) to do this, so offcially you'd need some kind of plugin like flash to do it for you, but a quick google search will help you too.

    *) update: as zentara rightly points out, you can use the <embed> tag, but that's not standard HTML; I think the <object> is the closest thing in the standards. I don't know how wide-spread support for it is, though.

Re: Sound Functionality With Perl
by zentara (Cardinal) on Apr 10, 2005 at 11:29 UTC
    You can try this. In your index.html put
    <EMBED SRC= "my.wav" autostart="true" hidden="true" loop="1">

    Or throw it into a cgi and dynamically generate the index.cgi.(Your httpd.conf must be configured for index.cgi though).


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