Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Perl CD Player?

by t0mas (Priest)
on Mar 06, 2001 at 16:36 UTC ( [id://62475]=note: print w/replies, xml ) Need Help??


in reply to Perl CD Player?

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-03-29 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found