A convenient trick to Convert Text into Audio File, this helps the user to listen generated audio clip while working on other stuffs. Generated file is portable in simple terms this file can run in any version of window machines. A user can use this file as like other files i.e. user can Email, copy-paste this file in other disks also.
Steps to convert Text into Audio File
- Open text editor. Let’s says Notepad.
- Copy the below code and paste into Notepad file.
Dim text, sapi
text="Enter your text here. Under quotes"
Set sapi=CreateObject("sapi.spvoice")
sapi.Rate = 2
sapi.volume = 100
sapi.Speak text - Replace your content at second line Under quotes.
- Save your file with any name with extension .vbs
- And the audible file is created. Click the file and open to hear audio
Code Description
Dim text,sapi
Declare variable text & sapi in Memory.
text="Enter your text here. Under quotes"
Assigning text value.
Set sapi=CreateObject("sapi.spvoice"
`Set` is used to assign the reference to a sapi object.
sapi.Rate = 2
Set speaking rate of the voice.
sapi.volume = 100
Set Volume property.
sapi.Speak text
Call Speak method in sapi object which initiates the speaking of a text string.
This is Visual Basic Script code. User can change set speaking rate of the voice and volume property (loudness) level of the sound.
Values for the Rate property range from -10 to 10, which represent the slowest and the fastest speaking rates, respectively.
sapi.Rate = Value
Values for the Volume property range from 0 to 100, representing the minimum and maximum volume levels, respectively.
sapi.volume = Value
Recommended: Chrome Hidden Text Editor with plugins.