SkipHuffman has asked for the wisdom of the Perl Monks concerning the following question:
I would like to control the sound card on a remote PC through a perl script on a web server.
Basically I have an old PC hooked up to my household sound system in a media closet. I can SSH to it and run mplayer to play a podcast or mp3 music over my home sound system. Works great. But I would like to make it a little more spouse and mother in law friendly by adding a web interface.
I built a little script, see below. But when I run this through a web server, it looks like it is running, but no sound comes out. I am guessing that the sound card cannot be accessed by the web server. How do I break through this?
#!/usr/bin/perl -wT use CGI qw(:cgi); use CGI::Carp qw(fatalsToBrowser); use CGI::Carp qw(fatalsToBrowser); $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin'; # my $input = param('input'); # Hardcoded file because I am lazy. Add input later. my $input = '/share/Music/podcasts/071115/sd20071114.mp3'; print "Content-type: text/html\n\n"; print "<center><h2>$input</h2></center>"; system "/usr/bin/mplayer $input"
|
|---|