El objeto SpeechSynthesizer para anexar la salida a un archivo que contiene audio en forma de onda.
1 2 3 4 5 6 7 8 9 10 11 |
$Path = "F:\power\file.wav" Add-Type -AssemblyName System.Speech $synthesizer = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer $synthesizer.SetOutputToWaveFile($Path) [xml]$doc=Invoke-WebRequest 'https://news.google.es/news?pz=1&cf=all&ned=es&hl=es&output=rss' $doc.rss.channel.Item | %{$synthesizer.Speak($_.title)} $synthesizer.SetOutputToDefaultAudioDevice() Invoke-Item $Path |