Error using speech2text
Mostra commenti meno recenti
Hi
When I downloaded speech2text in MATLAB 2018a and trying to run I am getting the following error:
Output argument "tableOut" (and maybe others) not assigned during call to
"BaseSpeechClient/speechToText".
Error in speech2text (line 45)
tableOut = connection.speechToText(y,fs,timeOut)
Error in stt (line 7)
outInfo = speech2text(speechObject,samples,fs,'HTTPTimeOut',25)
Immediate help is required
2 Commenti
Adam Danz
il 6 Dic 2019
Error in speech2text (line 45)
but speech2text() from that submission only has 40 lines. So either you're working with a different function or a different version of the function. If this is the correct file exchange submission you may want to download the newest version of the code and follow the instructions in the setup() file included with that submission.
Just FYI, I have never used this submission nor have I downloaded it.
Akshatha Prasad
il 6 Dic 2019
Risposte (3)
Update: checklist of requirements
I am not a contributor to the speech2text FEX submission. Here is a list of requirements summarized from the comments below this answer.
Since several functions in the speech2text submission are protected by p-codes or interface with 3rd party APIs, troubleshooting capabilities are limited.
At the bare minimum you must satisfy these equirements.
- You're using the most recent, up-to-date release of speech2text
- Your using Matlab r2017a or later (according to the FEX page)
- You're following the exact instructions listed in the setup.m file included in the submision and explained in the "Examples" tab of the speech2text FEX page.
- You have access to the 3rd party speech APIs which include Google™ Cloud Speech-to-Text API (which apparently costs money after the first 60 minutes), IBM™ Watson Speech to Text API, or Microsoft™ Azure Speech Services API, all of which require license.
- You must have the Audio Toolbox installed.
Original Answer below
Hmmm..... it still looks like you're not using the most recent version.
In this section of your error stack
Error in speech2text (line 39)
tableOut = connection.speechToText(y,fs,timeOut);
the tableOut variable is assigned on line 39 but in the latest version of the code, that line of code is on line 45. I think you have the old and the new versions of the files on your matlab path but matlab is still using the old version.
Based on comments left on the file exchange page, I suggest taking the following steps.
- Remove the old file from your matlab path (keep it for now but just remove it so matlab doesn't have access to it).
- Shut down and restart Matlab
- Add the path to the new files
- run the setup.m file that came with that submission
- try your code again
Please let me know if that worked or not in the comment below.
For what it's worth, I tried the submission but I don't have a Google authorization file (JSON file) so I could not proceed past the window that requests the file:

8 Commenti
Akshatha Prasad
il 6 Dic 2019
Adam Danz
il 6 Dic 2019
Well, it's not exactly the same error as you had before. This time it confirms that you're using the updated files since the line numbers are correct in your new error message.
The speech2text() function contains a variable timeOut and according to comments within that file, it's a 10 second timeout period (by default). This variable is sent to connection.speechToText which appears to be an interface with a 3rd party Speech Recognition APIs which I do not have access to.
My bet is that if some response doesn't happen within the timeout period, the interface gives up and that is why the tableOut output is never assigned.
Since I do not have access to connection.speechToText and since much of the code is protected in pcode files (which we cannot access), I've hit a dead end in terms of troubleshooting.
I can leave a comment on the file exchange and point the author(s) to this conversation in hopes for a response.
Akshatha Prasad
il 6 Dic 2019
Akshatha Prasad
il 6 Dic 2019
Adam Danz
il 6 Dic 2019
Based on the "try it for free" button on the main web page it seems to be a paid service.
Adam Danz
il 13 Dic 2019
Hi Akshatha,
As I mentioned a few comments above, since I don't have access to the Speech Recognition API nor to the content of the p-codes within the speech2text files, I can't really offer more advice than I already have.
At the bare minimum you must verify with 100% certainty the following requirements.
- You're using the most recent, up-to-date release of speech2text
- Your using Matlab r2017a or later (according to the FEX page)
- You're following the exact instructions listed in the setup.m file included in the submision.
- You have access to the 3rd party speech APIs which include Google™ Cloud Speech-to-Text API (which apparently costs money after the first 60 minutes), IBM™ Watson Speech to Text API, or Microsoft™ Azure Speech Services API
- To use speech2text, you must also have the Audio Toolbox installed.
Lastly, go to the speech2text FEX page and select the "Examples" tab. It provides detailed instructions on how to set up the API.
If you have verified those requirements, the problem likely resides within the code and since much of it is encrypted, my hands are tied.
Akshatha Prasad
il 13 Dic 2019
jibrahim
il 13 Dic 2019
0 voti
Hi Akshatha,
I am trying to get to the bottom of this. Can you please let me know what you get qwith the following:
1) which GoogleSpeechClient -all
How many hits do you get? I wonder if you have multiple clashing versions.
2) ver('audio')
What is the output of this function?
3) Please try to execute this line of code to make sure you have a license to execute functionality from audio toolbox:
mfcc(randn(1e5,1),44100);
10 Commenti
Akshatha Prasad
il 14 Dic 2019
Adam Danz
il 17 Dic 2019
The following comments were moved here from a series of answer/comments that have been deleted.
jibrahim's Comment
Hi Akshatha,
Interesting. I can't see how the source code would behave this way.
Let's try this:
1) Under Home -> Preferences -> General: Make sure 'Enable toolbox path cache' is unchecked. If it is checked, uncheck it and restart MATLAB
2) I have attached a modified version of a couple of files that hopefully will give us more details about what went wrong. Can you please replace your versions of those two files and see what you get?
Adam Danz
il 17 Dic 2019
Akshatha Prasad's comment
Hi jibrahim,
- I have unchecked 'Enable toolbox path cache'.
- I have replaced the files that you have sent and got the same error.
I am attaching the screenshot of what I am doing and what error I am getting.

Adam Danz
il 17 Dic 2019
Akshatha Prasad's comment
No jibrahim. Even that is showing the same error.
I have even changed the audio file and tested but the same error pops up.
Is this working successfully from your side.
Adam Danz
il 17 Dic 2019
My comment
@ jibrahim, all of these comments that are entered as answers might cause some confusion to future readers who may want to follow the discussion. Answers are resorted after an answer is accepted or voted. Then we lose the linear progression of comments while reading through the steps taken during troubleshooting.
If you agree, I'd like to clean this up by editing this thread so that all of the answer/comments are rewritten as comments under your first answer. Then when a conclusion is reached, you could edit your original answer to show the final solution. I won't do that without your OK but I think it's worth the time to keep it organized for future visitors.
Akshatha Prasad
il 17 Dic 2019
Modificato: Akshatha Prasad
il 17 Dic 2019
Akshatha Prasad
il 17 Dic 2019
Modificato: Akshatha Prasad
il 17 Dic 2019
Akshatha Prasad
il 19 Dic 2019
0 voti
Hi,
My problem got resolved with IBM Watson speech to text service.
I have tried with google but that is popping out an error. I think it is something to do with GoogleSpeech.p file where it is showing the error.
Thanks for helping me to understand the issue,
1 Commento
Adam Danz
il 19 Dic 2019
It may be helpful to share the full copy-pasted error message.
Categorie
Scopri di più su Data Augmentation in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!