I am doing project on speech signal analysis.how to convert speech to text any one help me

 Accepted Answer

Hi Nemala,
I work at MathWorks and I noticed this old question of yours just now. In case it was useful to others, I thought I'd leave a link to our recent MATLAB Central sumbission speech2text:
That enables to leverage 3rd party speech-to-text web services (so far including from Google, Microsoft and IBM) directly from MATLAB using a simple MATLAB Function. The syntax looks like the following:
>> [samples, fs] = audioread('helloaudioPD.wav');
>> soundsc(samples, fs)
>> speechObject = speechClient('Google','languageCode','en-US');
>> outInfo = speech2text(speechObject, samples, fs);
>> outInfo.TRANSCRIPT =
ans =
'hello audio product Developers'
>> outInfo.CONFIDENCE =
ans =
0.9385
Please refer to the html folder in the submission for a step-by-step getting started guide.
Thanks,
Gabriele.

11 Comments

How can I create speechClient object ? I got stuck in this point. Thank you
Hello,
The property-value pairs for speechClient vary depending on the specific service used (i.e. Google, IBM, Microsoft). You should find it useful to take a look at the "Create speechClient" section of the "Examples" tab of the submission page for speech2text - that also include links to the documentation of the respective services.
I hope this helps.
Gabriele.
Ichecked thta section and run this line to the command window;
speechObject = speechClient('Google','languageCode','en-US')
but it gave me an error 'Size and validator functions not supported for abstract properties.
Property 'Name' is abstract in class 'BaseSpeechClient'.
'
but I cannot open BaseSpeechClient or any other .p files because of the protection. Do I use wrong speechClient line?
Hello,
Your error stack looks like you hit a bug in speech2text code seen in MATLAB releases older than R2018b.
I have fixed the bug in the speech2text submission and verified that it works in MATLAB releases R2017a through R2018b. Please download the latest version of speech2text and try again.
Thanks,
Raja
Thank you so much it works so well
Hello
I have downloaded the latest version of speech2text in Matlab2018a.
When I am 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 appreciated.
Is there a way to use this speech2text program offline without connecting to the Internet?
Also, how can we add a new language package to this program?
Indeed, as of today speech2text uses a web API interface to access three different speech-to-text web services. You also need to create an account with either of the supported providers to use that feature.
If you need a local solution, you may want to try this recent submission based on the deep network wav2vec -- this will downloaded and run the actual network on your local machine as part of the setup process:
Note that this is a simple end-to-end deep learning model and not a a fully-featured service. One of the limitations is that the model version available only works for English and it doesn't have any dialect-specific variations. That said, its is a state-of-the-art model as far as single networks go and its performance is remarkable for many ordinary test cases. Let us know how that works for you!
Hello, I want to do a project for arabic speech to text conversion using matlab. Can I use wav2vec?
As of R2023b, all pre-trained speech-to-text models available with MATLAB via Audio Toolbox (including wav2vec) only support the English language.
For different languages, including Arabic, you want to use one of the cloud services supported by speech2text. Please remember that this workflow requires first creating an account with one of 4 supported services (Amazon Transcribe™ is also part of the mix since R2022b) and then downloading a credentials files onto a local folder on your MATLAB path. You can refer to the accompanying examples of speech2text for the details.
For Arabic specifically, you want to ensure you read the documentation of the service of your choice and identify the language localization most closely related to the content you need to transcribe.

Sign in to comment.

More Answers (1)

Not an answer for you, but in case anyone is interested in the reverse direction (text to speech).....If you have Windows, try .Net. Try this MATLAB code snippet:
% Program to do text to speech.
% Get user's sentence
userPrompt = 'What do you want the computer to say?';
titleBar = 'Text to Speech';
defaultString = 'Hello World! MATLAB is an awesome program!';
caUserInput = inputdlg(userPrompt, titleBar, 1, {defaultString});
if isempty(caUserInput)
return;
end; % Bail out if they clicked Cancel.
caUserInput = char(caUserInput); % Convert from cell to string.
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, caUserInput);
Speech to text is a lot more complicated of course.

4 Comments

Did you overlook Gabriele's answer above? Does that not help?
We can't do your project for you. You have to be more specific in what you need help with. At this point, it's just too vague for any of us to help. At this point in your project all we can do is to point you to software that can help you. If you have specific questions about small snippets of your code, we can help you, but please read this link first before you post your code, data, and specific question(s):
Hi, is there any possibility to function STT without an internet connection?
Asking because it makes use of various SAPIs
Please see the response provided to this same question in the main thread

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!