Playing Wav/Mp3s when users visit my Perl site
Posted by anthonysaulnier (anthonysaulnier), 10 April 2005Good day, I am trying to set up my web site in using Perl on a Red Hat 9.0 Apache 2.0 server so that when people visit my web site a wav or mp3 file will play. I have tried all sorts of things such as installing and using use Audio::Wav; but I have not had any luck what-so-ever . I have even tried using the HTML embed tags, but still no go.
I am using Perl and CGI scripting combined on the site and my site seems to work fine otherwise.
I was just wondering if anyone has any ideas on how I could set up my site to play wav files or knows where I can get good examples of code.
Posted by admin (Graham Ellis), 10 April 2005I'm not a great fan of sound on web sites ... so it's not something I've played with much. But I thought you could just embed sounds into a web site in much the same way you can embed images - I've just visited a Nursery Rhyme site and found
<bgsound src="midi/blacksheep.mid" loop="-1">
used to bring up the sound. I don't think you need Perl at all (??) - although you could usefully use it to manage and perhaps convert the sound file(s).
Posted by anthonysaulnier (anthonysaulnier), 10 April 2005HI Graham, thank you for your reply, I did try your suggestion but it does not seem to work for my perl/cgi script although I am sure that it would work great in the htdocs dir using html.
I am still trying to think of some ideas such as framing pages, put 1 html page with teh sounds together with my cgi page.
Posted by admin (Graham Ellis), 10 April 2005I've had a play / written a test program at http://www.wellho.net/cgi-bin/demo/trainsounds.pl. Have play ... see if you can get anything from it.
Posted by ed (ed), 19 April 2005You could always embed a little flash file that plays an mp3 into the HTML. Flash does quite a good job of compressing mp3s so that the filesize is small.
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho