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

Hi,

I wish to present a dynamic web page using perl which plays audio. I also want buttons to start and stop the audio, as well as a button that jumps to certain points within the audio.

I would like this to work on as many platforms and browsers as possible (Mac, Windows, Linux, Chrome, Android, IPad, Firefox etc) and am open to all your suggestions.

Thanks for your help,

John

Replies are listed 'Best First'.
Re: Play audio on a web page
by marto (Cardinal) on Nov 30, 2010 at 19:16 UTC

    What format of audio? I'm guessing not midi? You could help us to help you by being specific. See How do I post a question effectively?.

    I'm sure your perl code generates HTML, are you generating HTML5? If not you'll need a plugin or player which has nothing to do with perl, unless you're interested in streaming audio. See jQuery Audio plugins, google search for more information, or post some perl specific questions for further info.

      In a little more detail, I want to have 5 buttons on the screen, one for English, French, Spanish, Greek and Latin. When I press the English button, the voice begins speaking in English. When I press the Greek button, the speaker will begin the next sentence, in the sequence, in Greek. And so on. The audio is currently in ogg format but I can convert it if necessary.

      I have programmed Perl/CGI web pages before, on a Linux server. This was mainly the presentation of weather stats for various time periods. I'm not sure yet how this website will be hosted.

      Flash isn't supported by certain platforms...

      What I'm basically looking for is info regarding how this might be solved. Thanks!

        Thanks for the update. I don't think that there is a catch all solution for your question, catering for every browser/plugin set. One approach would be to provide various solutions (it would be easier if you were using a templating system such as HTML::Template or Template::Toolkit) catering for a cross section of platforms/browsers and redirect to them based on browser/plugin detection.

Re: Play audio on a web page
by zentara (Cardinal) on Nov 30, 2010 at 19:08 UTC
    Try the mplayerplugin, otherwise your design specification is hard to implement over a web interface.... you might look at how the flashplayer plugin does it

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re: Play audio on a web page
by ww (Archbishop) on Nov 30, 2010 at 19:09 UTC
    1. How do I post a question effectively?
    2. Do you know what flavor server you plan to run run this webap on?
    3. Do you know (or have you tried to learn) how to program with Perl?

    ... and are you aware that this is NOT a free-coding-service?

    As a quick reading of the introductory FAQs here will tell you, questions such as yours tend to get scratchy replies such as mine. OTOH, were you to present code, error messages if any, and other relevant data, many Monks would leap to your assistance.

    Try it!

Re: Play audio on a web page
by roboticus (Chancellor) on Nov 30, 2010 at 20:19 UTC

    I'd suggest playing the audio only in response to a control that's clearly marked. The second quickest way to keep me off your site for good is to play an unsolicited audio clip. (Flash is typically disabled on my machine, except when I explicitly want to be annoyed by noisy flashing crap.)

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.