use Win32::OLE qw( EVENTS ); get_text(); sub get_text{ $output_speech = <STDIN>; chomp($output_speech); if($output_speech ne ":q"){ say_this(); get_text(); } } sub say_this{ my $myTTS = new Win32::OLE( "Sapi.SpVoice" ); $myTTS->Speak( "$output_speech" ); while( $myTTS->{Speaking} ) { Win32::OLE->SpinMessageLoop(); Win32::Sleep( 100 ); } }
You need to create an account or log in to post comments to this site.