#!/usr/local/bin/perl
#


## fork off an autolyre process with a waveform, spectrogram, and lola file. ##

if(($auto_lyre_pid = fork) == 0) {
  exec("auto_lyre",
	"-xrm", "auto_lyre*waveform*horizscaleon:TRUE",
	"-xrm", "auto_lyre*tdat*horizscaleon:FALSE",
	"-xrm", "auto_lyre*lola*horizscaleon:FALSE",
	"-xrm", "auto_lyre*secsppix:.0025",
        "-xrm", $exp,
        "-xrm", $poscolors,
        "-xrm", "auto_lyre*tdat*exp:3",
        "-xrm", "auto_lyre*tdat*poscolors:150",
        "-geometry", "1000x490+0+0",
        "-basename", "foo",
        "-config", "W100.wav,S150.dft,L80.lola,L80.word");
}


##  None of the foo.* files exist yet but autolyre will be looking for stuff there.
##  Now we move the appropriate files into the foo.* files.

open(FILE,"ls *.wav |");

while($file=<FILE>) {
  system("cp si654.wav foo.wav");
  system("cp si654.dft foo.dft");
  system("cp si654.lola foo.lola");
  system("cp si654.word foo.word");

  print <<EOF;
Do you want to see another?(y/n)

EOF

  $answer=<STDIN>;
  chop($answer);
  if ($answer eq "n") { last; }

  system("/bin/rm foo.*");
}


kill(2,$auto_lyre_pid);




