Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • windows 10 won’t sleep 2020 Windows
  • Biggest Differences Between Nintendo Switch Lite and Nintendo Switch Gaming
  • How to Reset Factory reset of Google Home and Home Mini How-To
  • vat calculator israel

    Top hits of vat calculator israel. In the event you were previously collecting VAT in South Korea, you don't need to achieve that. Furthermore, VAT is

  • how to backup iphone to icloud iPhone
  • How to Go Live on TikTok 2023 technology
  • Best ti 30xs multiview calculator 2020

    Best ti 30xs multiview calculator 2020. 1 - Texas Instruments TI30XSMV TI-30XS MultiView Scientific Calculator, 16-Digit LCD Top Reviews

  • Top Ten amazon fire stick free channels Gadgets

How to Make Your Computer Talk/Speak What You Type

Posted on October 6, 2020 By blog_786 No Comments on How to Make Your Computer Talk/Speak What You Type

Windows has a cool feature that lets you make your computer say or say whatever you say to it! This method takes advantage of a built-in API found in Windows XP, Vista, 7, 8 and 10 called SAPI (Speech Programming Interface).

The Microsoft Speech API is what is used for the text-to-speech accessibility feature built into Windows. You can also write programs that call APIs, allowing your applications to speak, but that’s for developers.

It’s actually very easy to get your computer to say what you want! In this article, I’ll show you how to create a VBS script that accepts user input and then speaks it out. I’ll also show you how to hard-code the text you want to read, and then schedule that script to run on certain events, such as Windows startup or logoff.

Input text, pronounce the message

Let’s start with a simple script that will open a dialog box where you can enter what you want Windows to say. Open Notepad first.

Step 1. Paste the following text into a new document:

Faint message, sapi
message = InputBox (“Enter the text you want to speak,” “Speak”)
Install sapi = CreateObject (“sapi.spvoice”)
sapi.Speak message

Note that when you copy text from a web browser and paste it into Notepad, the quotes will cause problems. Before saving the file, you need to review and delete each quote (“) and re-enter the quote. The example below has six quotes. It should look something like the image below.

Now, when you are going to save the file, give it any name, but make sure you also type .VBS after the name. Then, in the Save as type box, select All files instead of default text documents.

Now double click on the VBS file and you should see an input box where you can enter the text you want to speak! Enter something and click OK.

How to Make Your Computer Talk/Speak What You Type

If you did everything correctly, you should hear a male or female voice pronouncing your phrase. If you receive any error message, be sure to copy and paste the text again and replace those quotes.

Configure SAPI Voice settings

It’s fun, but we can also customize our little talking computer with different settings. We can change the volume, speed or slowness of the voice, and also change the gender from male to female. Here’s some sample code where I’ve added a couple of extra lines.

Faint message, sapi
message = InputBox (“Enter the text you want to speak”, “Speak”)
Install sapi = CreateObject (“sapi.spvoice”)
Install sapi.Voice = sapi.GetVoices.Item (1)
sapi.Rate = 0
sapi.volume = 100
sapi.Speak message

The default speed is 0, the range is -10 to 10. -10 means the voice will speak very slowly and 10 means very fast. The default volume is 100 and the range is 0 to 100. The line that starts with Set sapi.Voice will allow you to switch to a different voice if installed on your system.

Please note that the number of voices you can choose depends on the operating system. There is only one voice in Windows 7, Microsoft Anna.

How to Make Your Computer Talk/Speak What You Type

Windows 10 has two voices, Microsoft David and Microsoft Zira, as shown below.

How to Make Your Computer Talk/Speak What You Type

How to Make Your Computer Talk/Speak What You Type

If you only have one voice installed on your system, you need to change what sapi.GetVoices.Item (1) says to sapi.GetVoices.Item (0) < / em>, otherwise you will get an error when you try to run the script. You can also create another Notepad document and paste the code below into it that will tell you which voices are installed. Save it as a .VBS file as shown above and run.

Install VObj = CreateObject (“SAPI.SpVoice”)
For each voice in VObj.getvoices
I = I + 1
msgbox “” & (I – 1) & “-” & Voice.GetDescription
Next

So far, we have used this popup dialog to enter text, but you can also just type your message into the script file. This would be useful if you want to schedule the script to run automatically. Obviously this can be used to prank your friends and family and it works really well.

Imagine that someone turns on their computer and hears the computer say to him, “Hi John, I really want to sleep, please don’t bother me today!” when it boots up! From experience I can promise that this is hysterical and you should definitely try it.

To hardcode the message, just change the last line to something like this:

sapi. Say, “Hi John, I’m really tired today!”

Schedule a script file

Now that you’ve hard-coded your message for the intended purpose, you just need to fire it whenever you want. If you’re tech-savvy, you can use a program like AutoIt, which will allow you to do extreme things, like running a script file when a certain program is open or when windows are maximized or minimized.

I don’t have time to go into detail on this in this post, but luckily Microsoft has a built-in feature called Task Scheduler that makes it easy to do fairly complex scripted tasks.

My previous post went into detail about how to schedule a script file to run when certain events occur on Windows. If you have any problems getting the script to work, feel free to leave comments and I’ll try to help. Enjoy!

–

Share this:

  • Twitter
  • Facebook
technology

Post navigation

Previous Post: Change Default Search Provider in Microsoft Edge to Google
Next Post: How to Hide Your Facebook Online Status

Related Posts

  • How to Find Songs or Audio Used in TikTok Videos technology
  • 7 Ways To Deal With Social Media Withdrawal technology
  • How to Volunteer for a Political Campaign Online technology
  • How to Preview a Game on Steam For Free technology
  • How to Give a TED Talk technology
  • How To Turn Your Old Computer Into An Arcade Machine technology

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • SmartDNS vs VPN – What’s the Difference?
  • How to go Back to the old YouTube Layout (2017)
  • A Simple Trick to Get 50% Discount on Audible for Three Months
  • What Is “Other” Storage on Android And How to Clean It Up ?
  • 7 Legal Websites to Get Free Music Downloads
DMCA.com Protection Status

Recent Posts

  • SmartDNS vs VPN – What’s the Difference?
  • How to go Back to the old YouTube Layout (2017)
  • A Simple Trick to Get 50% Discount on Audible for Three Months
  • 6 Best PayPal Alternatives (2017)
  • How to Fix the the “Invalid SIM Card” Error on Android

Recent Comments

  1. A Simple Trick to Get 50% Discount on Audible for Three Months on Private Browsing: What is it and What it is not
  2. 6 Best PayPal Alternatives (2017) on How to Save Money While Shopping Online in India
  3. Automatically Transcribe YouTube Video/Audio with Google Docs on 5 Best Team Management Apps (For Small and Large Teams)
  4. 6 Things You Need Know About Email Encryption on Delete All Emails from Gmail With Once Click
  5. Looking For YouTube Alternative? Try These 7 Video Sharing Sites on Ten Best YouTube Video Editing Software 2023
  • Extract Text from PDF and Image Files Free Software Downloads
  • 7 Best Wireless Keyboard And Mouse Combos For Any Budget Product Reviews
  • The best keyboard shortcuts required for Microsoft Word for better progress MS Office Tips
  • Best green calculator 2020 black
  • How to Stop Personalized Ads and Search Results in Google and Facebook How-To
  • 5 Best Humble Trove Games 2021 Reviews
  • How To Import Data Into Google Sheets From Another Sheet How-To
  • 4 Ways to Safely Backup iPhone iPad Photos and Videos Smartphones

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version