Why is speech to text in Access slower than in Word? (1 Viewer)

jacko6

Member
Local time
Today, 12:57
Joined
Jul 17, 2023
Messages
36
In MS Word (365) there is an icon on the ribbon for speech to text. It works quite well and the transcription is fast.

If you press the Windows Key + H in MS Access, the same speech to text microphone widget pops up and your speech will be transcribed to text, for example in a text box.

Does anyone know why this is so much slower in access? If so is there a way to speed it up?

I even used it to type this post and it's a lot more responsive than in Access.
 
I don't know for certain but given how MS treats Access, I'd guess that the developers never even considered that this feature might be useful to Access. I tried to use it years ago for a client with little success for an order entry application.

The only thing that comes to mind is whether the text box is plain text or rich text. Rich text might be slow due to the processing behind the scenes. I can't think of a reason why plain text would be a problem.
 
I added a web browser ctl to an access form, loaded a simple html page with a text box and shazam! Speech to Text is fast like in MS Word.

Now I just need a way to transfer the text from the html page to the textbox on my Access form.
 
So are you saying the text was HTML and that was what was causing the slowness? Please clarify so that others will understand.
 
I've used speech to text (dictation) in Access without issues but its only really suitable for comments in long text fields.
Moving to another control switches off the microphone. See my article:

For similar reasons, it isn't practical in Excel.
 
Now I just need a way to transfer the text from the html page to the textbox on my Access form.
You could use JavaScript to populate a var which can be referenced in vba. You would need to reference the container or text box in some way to populate the var. copilot and ChatGPT can help you with that
 
Hi Pat, my original post was about speech to text in a text box on an Access form - it is noticeably slower than in Word. In fact when I hit Win + H
I got a popup saying it isn't supported, although it does work, albeit slowly.

I then decided to try a html page in the Access Edge browser ctl. The html page includes a text box - speech to text is fast, just like in Word. As long as I can transfer the text from the html textbox to my Access form textbox I see this as a good workaround/solution to the aforementioned lag.

Note: Only the Edge browser ctl is fast for speech to text. The old browser ctl is laggy, similar to using speech to text in an access textbox.
 
Last edited:
Something like this reads the content of a textbox with no issue from my computer.
Code:
Private Sub MyButton_Click()
    CreateObject("sapi.spvoice").speak Me.MyTextbox
End Sub

Now, since you say you managed to make an HTML input read out loud its contents, I assume you're using SpeechSynthesisUtterance. That only works with Chrome and Firefox, it doesn’t work with Internet Explorer. The reason you can use it with the Edge browser control and not with the old browser control is that Edge is based on Chrome, so it’s compatible.
 
Hi Edgar, I'm referring to speech to text, not text to speech.
 
Now I just need a way to transfer the text from the html page to the textbox on my Access form.
You can read the contents of a textbox in an html page with:
Document.getElementById("elementID").Value

I added a Browser control to a form. Added a button(MyButton) and a textbox(MyTextbox)
Then set the control source of the browser to a page that contains a textbox named "User_ID"
Then on load event of the form:
Code:
Private Sub Form_Load()
    If oBrowser Is Nothing Then SetBrowser
    DoCmd.Maximize
End Sub

Private Function SetBrowser()
    Set oBrowser = Me.WebBrowser0.Object
End Function

And added this to the click event of the button:
Code:
Private Sub MyButton_Click()
    Stop
    If oBrowser Is Nothing Then SetBrowser
    
    With oBrowser
        ' Wait for the page to load
        Do While .Busy Or .ReadyState <> 4
            DoEvents
        Loop
        MyTextbox = .Document.getElementById("USER_ID").Value
    End With
    
End Sub
 
Thank KitYama, I believe that only works with the older browser control. Unfortunately speech to text is only fast in the Edge browser control so I need to use that.

.object is not available to the Edge browser control. ChatGPT is struggling to give me a solution that allows me to read the value from the html textbox (using the edge browser ctl) and add it to a textbox on my access form.

If anyone can crack this I would be most appreciative.
 
I'm sure @Edgar_ has a solution for it.
Let's suppose OP only has one input tag in the Edge Browser Control, then why not:
Code:
MsgBox BrowserCtl.RetrieveJavascriptValue("document.getElementsByTagName('input')[0].value")
 
Thanks Edgar, I actually just worked it out too and was coming back here to post my example.

Dim edgeBrowser As Object
Set edgeBrowser = Me.Controls("MyEdgeBrowserControl")
Dim htmlTextboxValue As Variant
htmlTextboxValue = edgeBrowser.RetrieveJavascriptValue("document.getElementById('mytextbox').value")

' Transfer the value to the Access form textbox
Me.myAccessTextBox = htmlTextboxValue
 

Users who are viewing this thread

Back
Top Bottom