Added txt2wav.ps1

This commit is contained in:
Markus Fleschutz 2020-05-22 07:54:16 +00:00
parent 33c3699d22
commit 20eae280f8
2 changed files with 31 additions and 0 deletions

View File

@ -3,6 +3,17 @@ Collection of PowerShell Scripts
Useful cross-platform PowerShell scripts, to be used on the command-line (CLI) or by automation software like Jenkins.
PowerShell Scripts
------------------
* password.ps1 - generates and prints a single new password
* passwords.ps1 - generates and prints a list of new passwords
* poweroff.ps1 - halts the local computer, administrator rights might be needed
* reboot.ps1 - reboots the local computer, administrator rights might be needed
* speak.ps1 - speaks the given text
* translate.ps1 - translates the given text
* txt2wav.ps1 - converts text into a audio .WAV file
* wakeup.ps1 - sends a magic packet to the given computer, waking him up
What is PowerShell?
-------------------
PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language.

20
txt2wav.ps1 Executable file
View File

@ -0,0 +1,20 @@
# PowerShell Script to Convert Text to Audio WAV files
# ----------------------------------------------------
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
# Configuration:
$Text = "Hello, my name ist Bond, James Bond"
$Speed = -1 # -10 is slowest, 10 is fastest
$TargetWavFile = "spoken.wav"
# Run:
Add-Type -AssemblyName System.Speech
$SpeechSynthesizer = New-Object System.Speech.Synthesis.SpeechSynthesizer
# $SpeechSynthesizer.SelectVoice("Microsoft Eva Mobile")
$SpeechSynthesizer.Rate = $Speed
$SpeechSynthesizer.SetOutputToWaveFile($TargetWavFile)
$SpeechSynthesizer.Speak($Text)
$SpeechSynthesizer.Dispose()
exit 0