Recording Audio Text Files

Share |

Join PowerShell.com!
Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Award-winning PowerShellPlus


Admin Guide to PowerShell Remoting


Mastering PowerShell eBook

Did you know that PowerShell can record audio messages? All you need is some text. You can then turn the text into spoken language, convert it to a WAV file and play it back or send it to someone. Here’s how:

$Path = "$env:temp\file.wav"

Add-Type -AssemblyName System.Speech

$synthesizer = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$synthesizer.SetOutputToWaveFile($Path)
$synthesizer.Speak('This is a recording.')
$synthesizer.Speak('Adding more to it')
$synthesizer.SetOutputToDefaultAudioDevice()

# Play back the recorded file
Invoke-Item $Path

Twitter This Tip! ReTweet this Tip!


Posted Feb 22 2012, 06:00 AM by ps1
Copyright 2012 PowerShell.com. All rights reserved.