MATLAB Answers

Error using speech2text

10 views (last 30 days)
Akshatha Prasad
Akshatha Prasad on 6 Dec 2019
Commented: Adam Danz on 19 Dec 2019
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
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
Akshatha Prasad
Akshatha Prasad on 6 Dec 2019
Hi Adam
I have downaloded the latest version from this file exchange submission.
I have created .m file (say, stt.m) and have the following code of 6 lines:
clear all;
[samples, fs] = audioread('on.wav');
soundsc(samples, fs)
speechObject = speechClient('Google','languageCode','en-US','maxAlternatives',3)
outInfo = speech2text(speechObject,samples,fs)
Now the same below error is thrown
Output argument "tableOut" (and maybe others) not assigned during call to
Error in speech2text (line 39)
tableOut = connection.speechToText(y,fs,timeOut);
Error in stt (line 6)
outInfo = speech2text(speechObject,samples,fs)

Sign in to comment.

Answers (3)

Adam Danz
Adam Danz on 6 Dec 2019
Edited: Adam Danz on 13 Dec 2019
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.
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.
  1. Remove the old file from your matlab path (keep it for now but just remove it so matlab doesn't have access to it).
  2. Shut down and restart Matlab
  3. Add the path to the new files
  4. run the setup.m file that came with that submission
  5. 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:
Akshatha Prasad
Akshatha Prasad on 13 Dec 2019
Thanks Adam for your reply.
I have verified all the requirements that you have listed out.
As far as I know there is some error in those .p files. I have also noticed that few people have asked same question in many forums but no proper solution for that. I think authors of the submission should consider this and revise the code or respond as to what to do additionaly in order to make that code work.

Sign in to comment.

jibrahim on 13 Dec 2019
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:
Akshatha Prasad
Akshatha Prasad on 17 Dec 2019
What does the below lines mean?
"Since each of the APIs support varied number of input parameters and the parameters have different names, you are expected to provide the correct input for the API. If the API returns any error due to incorrect input parameters, then the speech2text function captures and reports the error."
I have found these lines from the example section of the speech2text file exchange.
Also I have another doubt,
Do we need to give billing information compulsorily in order to use Google's Speech to text API in our application.

Sign in to comment.

Akshatha Prasad
Akshatha Prasad on 19 Dec 2019
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 Comment
Adam Danz
Adam Danz on 19 Dec 2019
It may be helpful to share the full copy-pasted error message.

Sign in to comment.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!