Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Prototype - Command line, controllable, media player

by holli (Abbot)
on Nov 26, 2009 at 16:07 UTC ( [id://809595]=note: print w/replies, xml ) Need Help??


in reply to Prototype - Command line, controllable, media player

A command lined based program playing audio? Seriously, who needs this?


holli

You can lead your users to water, but alas, you cannot drown them.
  • Comment on Re: Prototype - Command line, controllable, media player

Replies are listed 'Best First'.
Re^2: Prototype - Command line, controllable, media player
by sv87 (Acolyte) on Nov 29, 2009 at 18:16 UTC

    A command-line media player is also convenient sometimes from a resources standpoint. In my personal experience, I've found command-line tools like a CLI media player, for instance, very good from a memory/CPU usage standpoint. They tend to use a lot less of it. :-) And I like the basic Unix philosophy of 'small, specialized tools suited to do one task, and to do it well.'

    Whether I would use a media player coded in Perl however, that I don't know.
    (Don't get me wrong, I love Perl.)

    Still, an interesting use of Perl nonetheless. :-) It really is the Swiss army knife of programming languages.

    Reach out and grep someone.
Re^2: Prototype - Command line, controllable, media player
by Kirsle (Pilgrim) on Nov 28, 2009 at 23:39 UTC

    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.

Re^2: Prototype - Command line, controllable, media player
by xyzzy (Pilgrim) on Dec 04, 2009 at 21:21 UTC

    I do. Of my two current computers (both laptops) one is has a burned out video card and one is an eeePC 701 that fell into a river.

    Everyone knows that if you can't do it from a command line then there's no point in doing it at all.

    $,=qq.\n.;print q.\/\/____\/.,q./\ \ / / \\.,q.    /_/__.,q..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://809595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2024-04-18 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found