From 753b25be6e462528c08b8d4f3365fc069ab807a9 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Fri, 29 Nov 2013 16:25:47 -0500 Subject: [PATCH] Use paplay from espeak. --- calendar-export.plx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/calendar-export.plx b/calendar-export.plx index c86a451..446d0ec 100755 --- a/calendar-export.plx +++ b/calendar-export.plx @@ -117,8 +117,15 @@ my $LOCK_CLEANUP_CODE = sub { print $fh "Calendar Export Failure: $message\n"; $fh->close(); system('/home/bkuhn/bin/myosd', $fname); - system("/usr/bin/espeak", '-p', '45', '-s', '130', '-f', $fname) - unless -f "$ENV{HOME}/.silent-running"; + unless (-f "$ENV{HOME}/.silent-running") { + open(ESPEAK, "-|", "/usr/bin/espeak", '-p', '45', '-s', '130', '-f', $fname, "--stdout"); + open(PAPLAY, "|-", "/usr/bin/paplay"); + my $data; + while (read(ESPEAK, $data, 8) == 8) { + print PAPLAY $data; + } + close PAPLAY; close ESPEAK; + } system('/usr/bin/notify-send', '-u', 'critical', '-t', '300000', 'Failure', "Calendar export failure: $message"); $messageHistory{$message} = $NOW;