Skip to main content

Posts

Showing posts with the label How to stream a text file to speaker using VBA

VBA : How to convert text file to speech (audio) using VBA

Text to Speech using Excel VBA : Audio/Speech from input file If you want to spell out the content of text file using VBA you can do it as shown below: Sub Speech_FromFile_Example() Dim oVoice As SpVoice ' Voice Object Dim oVoiceFile As SpFileStream ' File Stream Object Dim sFile As String ' File Name Set oVoice = New SpVoice Set oVoiceFile = New SpFileStream ' -------------------------------------------------------------- ' Code for http://vbadud.blogspot.com ' -------------------------------------------------------------- oVoice.Speak "This is an example for reading out a file" sFile = "C:\ShasurData\ForBlogger\SpeechSample.txt" oVoiceFile.Open sFile oVoice.SpeakStream oVoiceFile End Sub The above code creates a filestream and reads the text file and the Voice object speaks it out! The code requires Microsoft Speech Object Library (see figure below) See also:...

Facebook

Facebook Recommendations

Followers


Web Designing In Karachi



Haroof.com


Politics blogs

My Zimbio

Email Subscribe

Enter your email address:

Watch online Live TV

Labels

Show more