Error using speech2text

7 次查看(过去 30 天)
Akshatha Prasad
Akshatha Prasad 2019-12-6
评论: Adam Danz 2019-12-19
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 个评论
Adam Danz
Adam Danz 2019-12-6
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 2019-12-6
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)

请先登录,再进行评论。

回答(3 个)

Adam Danz
Adam Danz 2019-12-6
编辑:Adam Danz 2019-12-13
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 个评论
Adam Danz
Adam Danz 2019-12-13
编辑:Adam Danz 2019-12-13
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 2019-12-13
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.

请先登录,再进行评论。


jibrahim
jibrahim 2019-12-13
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 个评论
Akshatha Prasad
Akshatha Prasad 2019-12-17
编辑:Akshatha Prasad 2019-12-17
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 2019-12-17
编辑:Akshatha Prasad 2019-12-17
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.

请先登录,再进行评论。


Akshatha Prasad
Akshatha Prasad 2019-12-19
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 个评论
Adam Danz
Adam Danz 2019-12-19
It may be helpful to share the full copy-pasted error message.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by