I think crazyinsomniac is right about a networked CD player, but if you want to play local CDs, here's something to get you started (if you can stand OLE :)
#!/usr/bin/perl -w # Modules use strict; use Win32::OLE; use Win32::OLE::Variant; # Variables use vars qw($Player $stop); # Initialize OLE Win32::OLE->Initialize(Win32::OLE::COINIT_MULTITHREADED); # Create a new OLE object $Player = Win32::OLE->new('MCI.MMControl.1') or die Win32::OLE->LastError(); # Set stuff $Player->{Notify} = Variant(VT_BOOL, 0); #off $Player->{Wait} = Variant(VT_BOOL, 1); #on $Player->{Shareable} = Variant(VT_BOOL, 0); #off $Player->{DeviceType} = "CDAudio"; # Open device $Player->{Command} = "Open"; # Skip first 3 songs print "Skipping songs...\n"; foreach (1..3) { $Player->{Command} = "Next"; } # Plays from 4th song... $Player->{Command} = "Play"; # ...until user presses enter print "Press enter to stop playback...\n"; $stop=<STDIN>; # Stop $Player->{Command} = "Stop"; # Close device $Player->{Command} = "Close"; print "Done.\n";


/brother t0mas

In reply to Re: Perl CD Player? by t0mas
in thread Perl CD Player? by sierrathedog04

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.