Skip to content

Instantly share code, notes, and snippets.

@mlbright
Created September 17, 2015 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlbright/a8a8e0af0e79158095a2 to your computer and use it in GitHub Desktop.
Save mlbright/a8a8e0af0e79158095a2 to your computer and use it in GitHub Desktop.
Windows text to speech
#!/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