MATLAB Answers

How to convert Speech to Text

184 views (last 30 days)
I am doing project on speech signal analysis.how to convert speech to text any one help me

  1 Comment

Stephen Cobeldick
Stephen Cobeldick on 1 May 2015
Did you try an internet search? There are lots of discussions about this topic. Maybe this would be good starting place:

Sign in to comment.

Accepted Answer

Gabriele Bunkheila
Gabriele Bunkheila on 16 Jan 2018
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.

  7 Comments

Show 4 older comments
gozde nur
gozde nur on 22 Feb 2019
Thank you so much it works so well
Akshatha Prasad
Akshatha Prasad on 5 Dec 2019
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.
Talal Salim
Talal Salim on 29 Mar 2020
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?

Sign in to comment.

More Answers (2)

Image Analyst
Image Analyst on 1 May 2015
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.

  0 Comments

Sign in to comment.


zahoor mosad
zahoor mosad on 23 Jun 2019
please send me the code to my gmail zahoormosad@gmail.com. It will be great help for my thesis. I'm never forget your kindness.

  1 Comment

Image Analyst
Image Analyst on 23 Jun 2019
Did you overlook Gabriele's answer above? Does that not help? Exactly what kind of code were you looking for? What is the topic of your thesis?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!