As an example...

I was working on a Perl/Tk chat client for a chat server that uses a proprietary protocol. After it got several version numbers mature, I wanted to add some simple sound effects to it, such as playing a sound that was appropriate for the chat server when users entered or exited the room.

On Windows I could've used Win32::Sound or Win32::MediaPlayer - I ended up using the latter. But this program has historically been very cross-platform and if I were to add sound effects to the Windows client, I needed to also have sound effects for other operating systems.

I ended up just using the `play` command (from SOX on Linux) as a default for Linux, and `afplay` as a default for Mac OS X. On Win32 it would automatically use Win32::MediaPlayer, but on all other platforms a command-line program was configurable (if the user wanted to use `mplayer` instead of `play`, they could customize that).

Now I know about GStreamer for Linux, but there's still no relatively easy module for OS X for playing sound. So this is just one example of why a command-line audio player is useful.

The downside to `play/afplay` is that you can't control it once you start it, so it's only suitable for short sound effects. So, a command-line media player that can be commanded and controlled once it begins would be good for similar situations as this, except when longer music clips are desired and not just short sound effects.


In reply to Re^2: Prototype - Command line, controllable, media player by Kirsle
in thread Prototype - Command line, controllable, media player by Kirsle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.