Text to Speech Example Database (1 Viewer)

Status
Not open for further replies.

isladogs

MVP / VIP
Local time
Today, 12:34
Joined
Jan 14, 2017
Messages
18,186
This is a quick demo to show text to speech can be added to an Access database.
It follows on from the speaking clock that I uploaded some time ago



Click on a button and the sample text will be converted to speech
You can also enter your own text and get that played back ...

I find it works well for almost all cases though some words can be pronounced in 2 ways depending on context e.g. live, sow
Long words like 'antidisestablishmentarianism' or 'supercalifragilisticexpialidocous' - no problem
It even makes a pretty good attempt at 'otorhinolaryngologist' which I struggle to say

Of course the real fun is trying to get it to mispronounce words ... or to swear at you!

There are some serious uses for doing this e.g. assistance for those with poor sight.
If you click the checkbox at the bottom of the form, the control tip text for e.g. a button will be spoken when the mouse is moved over the button.
Unless you do have poor sight, you will probably want to switch that feature off again fairly quickly ....!

NOTE:
The database requires the Microsoft Speech Object Library reference which has been in all versions of Windows since XP if not before.
If the reference is missing, check you have Speech Recognition enabled in Windows Control Panel / Settings
 

Attachments

  • Text2Speech.png
    Text2Speech.png
    26.5 KB · Views: 3,255
  • Text2Speech.zip
    42.6 KB · Views: 1,387
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:34
Joined
May 7, 2009
Messages
19,175
In excel

Application. Speech. Speak "hello "
 

isladogs

MVP / VIP
Local time
Today, 12:34
Joined
Jan 14, 2017
Messages
18,186
As with a lot of things, TTS is easier to do in Excel than Access

To read the contents of cell A1 in Excel, you would just do this:

Code:
Private Sub TTS()

    Dim strText As String
    
    strText = Workbooks("Book1").Sheets("Sheet1").Range("A1")
    
    Application.Speech.Speak strText, 0, 0, -1

End Sub

For more info on TTS in Excel, see this link (which I believe is where arnelgp got his example from):
https://msdn.microsoft.com/VBA/Excel-VBA/articles/speech-speak-method-excel
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom