Advertisement
metalx1000

Text to Speech

Sep 30th, 2016
829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Say-Text {
  2.     param ([Parameter(Mandatory=$true, ValueFromPipeline=$true)] [string] $Text)
  3.     [Reflection.Assembly]::LoadWithPartialName('System.Speech') | Out-Null  
  4.     $object = New-Object System.Speech.Synthesis.SpeechSynthesizer
  5.     $object.Speak($Text)
  6. }
  7.  
  8. Say-Text "Hello World"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement