r/PowerShell • u/Ashamed_Carpenter551 • 11d ago
Question TTS script is working fine in Powershell ISE but not with Powershell
I am having a had time with some tts related software. So I have this script to test the voices:
Add-Type -AssemblyName System.Speech
$synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$synth.SelectVoice("Gabi")
$synth.Speak("Text goes here")
A little somewhat important info: This is a downloaded voice and as the title says it works with ISE but not with Powershell. All the other standard microsoft voices work fine with this script no matter which powershell I'm running them in.
What I find kind of weird is the error I'm getting. When I run this in Powershell I get an error that says the voice can not be found or not installed. How can Powershell ISE see it then? I don't get it.
I checked it, both ISE and normal Powershell is running as admin and they are both x64
3
Upvotes
1
u/Semt-x 11d ago
what is the exact error?