I have pasted the perl script below. Here, I have stored audio files into the mysql database. the "print `vlc "@row"`;" statement launches vlc and starts playing. But it is not quitting after sleeping fot 10 sec. What do i need to do for that?
Code:
#!usr/bin/perl use strict; no strict "vars"; use warnings; use DBI; $dbh = DBI->connect('dbi:mysql:audio', 'root', 'ajitteli') or die "connection error: $DBI::errstr\n"; print "Enter the number of songs to be played: "; my $num = <stdin>; for (my $i=1; $i<=$num; $i++) { $sql = "select file_path from audio_table where id like $i"; $sth = $dbh->prepare($sql); $sth->execute or die "SQL Error: $DBI::errstr\n"; #use IPC::open3; # my %videoInfo = videoInfo($sth); # $durtn = $videoInfo{'durationsecs'}; while (@row =$sth->fetchrow_array) { print "\n\nPlaying song $i\n\n"; print `vlc "@row"`; print "song$i stopped\n"; sleep 10; print `vlc://quit`; }
Comment