Created
September 17, 2015 23:34
-
-
Save mlbright/a8a8e0af0e79158095a2 to your computer and use it in GitHub Desktop.
Windows text to speech
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.018; # Why not?! | |
use Win32::OLE; | |
$Win32::OLE::Warn = 3; | |
my $speaker = Win32::OLE->new('SAPI.spvoice'); | |
while (my $line = <DATA>) { | |
next unless $line =~ /\S/; | |
$speaker->Speak( $line ); | |
} | |
__DATA__ | |
I'm sorry Dave, I'm afraid I can't do that. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment