This is a continuation of the previous node, posted as a new node so people will actually see it (as the old one has dropped off newest node.) Anyways.

From my last node, i received a lot of responses detailing how i could interface with winamp. While this would probably work very nicely, during my researches i found mpg123 (and now having a version that works) i've become slightly obsessed with just using a simple command line program to play mp3s, one that would 'waste' all the resources that using winamp would entail. My first idea was that i could make a primitive stop/start system just by calling mpg123 with the name of the song, then killing the process when i want it to stop. However, the process will not die when i manually start it in the background (mpg123 /mp3/X.mp3 &), then any attempt to call kill on its process id meets with utter failure. However, when i start it in 'foreground' mode (Without the apersand) then pressing ctrl-c will kill it nicely. Which leads me to

Question one: Is there anyway i could easily start/stop a process from perl?

However after my attempts of that nature failed, i hit upon the idea of attempting to just feed the mp3 player via stdin. However, then i hit a new snag, namely perl will not print an mp3 file. Every attempt to read a mp3 file and print it, either to a file or to the console or whatever, has met with complete and utter failure. In a response to my previous node, someone mentioned something about control charcters in the mp3 file. Which is thus

Question two: Is there anyway to convince perl to read/write mp3 files without dying horribly?

In reply to Mp3 PLayer. Part Two! by BUU

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.