Text to Speech
By Richard Rost
4 years ago
Text to Speech in Microsoft Access
Who doesn't want their Access database to scold them when they have past due invoices? Here's a little fun bit of code to get your database to speak to you.
Samantha from Pittsburgh, Pennsylvania (a Gold Member) asks: Is there any way I can have Access read off (speak) my team's hourly sales total? I think that would be a huge morale booster in our office. :)
Check out Mike Wolfe's blog for more information and links to other resources on speech synthesis.
Links
Recommended Courses
Keywords
access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, Use the Speak text-to-speech feature, Voice Generator, speech synthesis, tts
Subscribe to Text to Speech
Get notifications when this page is updated
Intro In this video, you'll learn how to add text-to-speech functionality to your Microsoft Access database so Access can read out information, like your team's hourly sales total. I'll show you the steps to integrate a simple code example that uses the Windows Speech API, demonstrate how to set up a button to make Access speak your desired text, and discuss how you can customize the voice settings. If you've ever wanted Access to talk back to you, this tutorial will walk you through how to make it happen.Transcript Welcome to another Fast Tips video brought to you by AccessLearningZone.com. I'm your instructor, Richard Rost.
In today's video, I'm going to teach you how to make Microsoft Access scold you when you're bad. We're going to learn Text to Speech. Here we go.
Today's question comes from Samantha in Pittsburgh, Pennsylvania, one of my Gold members. Samantha says, Is there any way I can have Access read off or speak my team's hourly sales total? I think that would be a huge morale booster in our office.
Yes, Samantha. I actually do the same thing. I've got my computer set up so every hour it reads off my sales total, and that's just a nice little thing to hear in the background while you're working. Yes, it is a bit of a boost - well, if sales are good that day. If not, then it's not a big deal, you just have to get your butt moving.
Anytime I sit down to do one of these videos, I do a quick Google search. I check the interwebs, the Google machines, to see what's out there on it. I remembered about a year ago, Mike Wolfe did an article on text to speech with Microsoft Access and we even had a couple of comments down there. I commented on it myself. I said, Nobody seemed interested in having your accounting database yell at you, Your customer Joe Smith is 30 days late on his invoice, make him pay. Not everyone wants this, but I figured I had a couple of people ask me how to do it.
Mike's got some really cool, really simple short code right there and it works great. I'm going to put a link to this in the description down below so you can click on it and just copy that code right there.
How do you do it? Well, just come in here, click copy like that (Control-C), then come over to your database. I made my status box here, I put some text in it and I put a button on here.
In that button's code, I do a check for null first. I say, If that status box is null, exit the sub, don't do anything. But otherwise, speak status box. Now, Speak is the procedure that was on Mike's website and it's right here. I changed it from male to female. I think it sounds better, and that's all that's right there. It uses the Speech API that comes with, I believe, Windows or Office, one of the two, and that's it. That's all you need.
You come back out here and click - "Space, the final frontier. These are the voyages of the Starship Enterprise. Space, the final frontier. These are the voyages of the Starship Enterprise."
I remember when I was younger, getting a computer to talk was a big deal. I had a TRS-80 Color Computer, it was my first computer and they had this big pack, this round pack you could plug into your expansion pack and it would make the computer be able to talk like that. Very Stephen Hawking, but it could still talk, and that was the coolest thing. Nowadays it's no big deal, right? Four lines of code.
If you're interested in learning more, on Mike's website, he's got more stuff in here and there are some links to Colin Riddington's website. He's got some extra stuff that you might want to check out. Cool stuff.
So there's your Fast Tip for today. I'll put links to all this stuff down below. Go check out Mike's website, Colin's website. I'll put a copy of the code in my Code Vault for free for everybody, and if you have any questions or comments, post them down below.
That's it. We'll see you next time.Quiz Q1. What is the main topic of this video tutorial? A. Creating custom forms in Microsoft Access B. Utilizing Text to Speech features in Microsoft Access C. Importing data into Access from Excel D. Generating graphical reports in Access
Q2. What prompted the creation of this video? A. A request for Access beginner basics B. A student wanted to print reports automatically C. A question about making Access read sales totals aloud D. A need to learn how to backup databases
Q3. Which resource did Richard mention as containing helpful sample code for this task? A. Microsoft official documentation B. Colin Riddington's website only C. Mike Wolfe's article D. AccessLearningZone's main forum
Q4. What is the main programming feature used in Access to achieve text to speech? A. Charting API B. Data Import Wizard C. Speech API D. Print Preview
Q5. What should the button's code do if the text box (status box) is empty? A. Display an error message B. Speak the word "Empty" C. Exit the subroutine and do nothing D. Automatically insert default text
Q6. What did Richard change in the sample speech procedure he used? A. Changed output language to French B. Changed the code from female to male voice C. Changed the code from male to female voice D. Removed the speech functionality
Q7. According to Richard, how complex is the code needed for text to speech in Access? A. Over 100 lines B. About 50 lines C. Just a few lines D. It requires external software
Q8. Which system feature supports the speech functionality used in the video? A. Windows or Office Speech API B. Access RunTime only C. SQL Server Integration D. Access Web App
Q9. Where can viewers find the sample code shared in the video? A. In a paid online course B. In the Code Vault for free C. By emailing Richard D. On the Microsoft store
Q10. What is suggested if viewers have more questions or want to discuss this topic? A. Attend a live webinar B. Post questions or comments below the video C. Buy Richard's textbook D. Submit a support ticket
Answers: 1-B; 2-C; 3-C; 4-C; 5-C; 6-C; 7-C; 8-A; 9-B; 10-B
DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.Summary Today's video from Access Learning Zone focuses on teaching you how to have Microsoft Access use text-to-speech to read messages aloud. This feature can be especially useful, for example, if you want your database to announce your team's hourly sales total, which can help boost morale in the office.
I received a question about this from one of my Gold members, Samantha. She wanted to know if there was a way for Access to read off hourly sales totals automatically. I do this myself, having my computer announce my sales numbers every hour in the background. It really is a nice little perk when things are going well.
Before recording, I did a quick search to see what others have done with Access and text-to-speech. Mike Wolfe wrote a helpful article on this subject about a year ago, and there were some interesting comments on his post, including one from me. Not everyone wants their database to call out, for example, that a customer is overdue on an invoice, but there have been several requests for this kind of functionality.
Mike provided a simple bit of VBA code for text-to-speech in Access. If you want to add this to your database, all you need to do is copy that code and paste it into your Access database. I also created a sample form with a status box to hold the text and a button to trigger the speech.
In the button's event code, I first check if the text box is empty. If it contains a value, I then call the Speak routine. The Speak procedure itself is adapted from Mike's code, but I changed the voice from male to female because I prefer it that way. This procedure uses the built-in Windows Speech API, so there is nothing extra you need to install.
When you press the button, Access reads aloud whatever text is in the status box. It's a fun feature that brings back memories for me. Years ago, getting a computer to speak took a lot of effort. Now it's very simple and only requires a small amount of code.
If you want to explore further, check out Mike Wolfe's website for more information and additional examples. He also links to Colin Riddington's website, which offers further resources on the topic.
That covers today's Fast Tip. I'll make sure to include links to all the relevant resources. The sample code will be available for free in my Code Vault. If you have any questions or comments, feel free to share them.
You can find a complete video tutorial with step-by-step instructions on everything discussed here on my website at the link below. Live long and prosper, my friends.Topic List Using the Speech API in Microsoft Access
Copying and pasting text to speech VBA code
Adding a button to trigger speech output
Checking for null values before speech
Customizing the voice gender in text to speech
Integrating text to speech in an Access form
|