MATLAB Answers

Error using speech2text

13 views (last 30 days)
Akshatha Prasad
Akshatha Prasad on 6 Dec 2019
Commented: Adam Danz on 19 Dec 2019
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 Comments

Adam Danz
Adam Danz on 6 Dec 2019
Are you using this file exchange submission ? Your error indicates
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
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:
clc;
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
"BaseSpeechClient/speechToText".
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:

  8 Comments

Show 5 older comments
Adam Danz
Adam Danz on 13 Dec 2019
Akshatha Prasad's answer moved here as a comment.
Hi Adam,
Did you find any solution for this.
Adam Danz
Adam Danz on 13 Dec 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.
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
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
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:
mfcc(randn(1e5,1),44100);

  10 Comments

Show 7 older comments
Adam Danz
Adam Danz on 17 Dec 2019
jibrahim's Comment
Hi Adam,
Absolutely, please go ahead and edit at will, and thank you for taking the time to organize this. Sorry, I am a MATLAB answers newbie :)
Akshatha Prasad
Akshatha Prasad on 17 Dec 2019
Hi jibrahim,
Then where is the problem.
How to resolve this issue.
I have deleted previously generated .json file.
I have tried to generate new API key from google cloud and downloaded new .json file and tried with that.
same error pops out.
I want this speech2text conversion in my MATLAB project.
Is there any other alternative.
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
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 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.

Sign in to answer this question.

Products