mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-16 07:38:15 +02:00
Moved .ps1 files to subdir Scripts/
This commit is contained in:
20
Scripts/txt2wav.ps1
Executable file
20
Scripts/txt2wav.ps1
Executable 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
|
Reference in New Issue
Block a user