Windows: Audio file export
Hi, as you are calling out to PowerShell and using the system speach synth, there are some really easy wins.
For example, there is no reason why you couldn't implement the export function as this is easily done.
Please see the following article on how to do this: https://learn-powershell.net/2013/12/04/give-powershell-a-voice-using-the-speechsynthesizer-class/
commands = [ 'Add-Type -AssemblyName System.speech; $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer; $speak.Speak([Console]::In.ReadToEnd())' ];
changing to:
commands = [ 'Add-Type -AssemblyName System.speech; $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer; $speak.rate( = -5; $speak.Speak([Console]::In.ReadToEnd())' ];
will slow down the output speech for example. Speeds are absolute from -10 to +10.
You could also change to async output by replacing $speak.Speak with $speak.SpeakAsync
More examples at: http://www.adminarsenal.com/admin-arsenal-blog/powershell-text-to-speech-examples/
Can you write a PR for this and confirm that it works on Windows?
Bit short on time right now but I'll see what I can do.
Speed is already handled in #46, but the async output is nice.
Speed and Voice are now fully implemented by #67 and #68!
Repurposing this issue just to track Windows export support.
According to the linked article this can be done via:
$speak.SetOutputToWaveFile("C:\users\Administrator\Desktop\test.wav")
$speak.Speak("Would you like to play a game?")
$speak.Dispose()
I might be able to give it a shot this week!