MATLAB Answers

Hello can anyone give me the codes for text to speech conversion and also speech recognition thank you

24 views (last 30 days)
Snehitha Kavuri
Snehitha Kavuri on 17 Sep 2015
Answered: jibrahim on 11 Feb 2020
Need matlab code for text to speech conversion and speech recognition

  0 Comments

Sign in to comment.

Answers (5)

Image Analyst
Image Analyst on 17 Sep 2015
For text to speech, if you have Windows, you can try my demo program:
% 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 recognition is harder I think, because of all the different speakers and accents they could have. Anyway, I don't have any demo for that.

  3 Comments

Anisio Gomes
Anisio Gomes on 18 Feb 2016
Is there a way for matlab identify if the system is window or mac. because I'm using mac and this code doesn't work, but is I use:
system('say anything');
It works. And I want to write a general program
Walter Roberson
Walter Roberson on 19 Feb 2016
Anisio, see
ispc()
ismac()
isunix()
Note: isunix() is true on MAC, so if you wanted to test for Linux that could be isunix() && ~ismac()

Sign in to comment.


Balaji Prasath Madhaiyan
Balaji Prasath Madhaiyan on 19 Feb 2017
can matlab produce arabic text to speech conversion?

  3 Comments

Walter Roberson
Walter Roberson on 19 Feb 2017
Yes.
The larger question would be how much work it would be to do, which is something I cannot estimate. English is difficult to do well because the same sounds can be represented by different characters and the same characters can represent multiple sounds and what something should sound like depends on context; also in English the sounds are affected by the pattern of stresses in the word which can change depending on suffixes distant from the part whose sound is changing. I do not know anything about the structure of Arabic so I do not know if it has similar challenges. I thought I have read in the past that the vowel markings in Arabic are not always present?
huda farooqui
huda farooqui on 11 Mar 2018
Hey Roberson.. please let me know how can i do part of speech tagging in english text to speech conversion?
and one more thing do you know how to split a waveform in matlab when it reaches minimum threshold... i want to split wave when it reaches minimum amplitude ...
Walter Roberson
Walter Roberson on 11 Mar 2018
Modern English is losing the distinction between adjectives and adverbs, so it is becoming difficult to do part of speech tagging. Semantic analysis in English is difficult work. Google translate does not even try: it does neural network type work by comparing corpuses of translated texts. Google reported that its AI have spontaneously developed an internal intermediary language for translation between different languages.

Sign in to comment.


Anisio Gomes
Anisio Gomes on 22 Feb 2016
Hi Image, do you have this text to speech code for mac?

  3 Comments

Walter Roberson
Walter Roberson on 22 Feb 2016
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.
system( sprintf('say "%s"', caUserInput) )
taha khan
taha khan on 26 Apr 2018
'say' is not recognized as an internal or external command, operable program or batch file.
this error shows when copy and past? why?
Walter Roberson
Walter Roberson on 26 Apr 2018
taha khan:
Anisio Gomes asked specifically about code for mac. "say" is code specific to Mac. The error message you posted is specific to MS Windows, so we can tell that you are not using Mac.

Sign in to comment.


taha khan
taha khan on 26 Apr 2018
Error using NET.addAssembly Attempt to execute SCRIPT addAssembly as a function: C:\Program Files\MATLAB\R2017a\toolbox\matlab\winfun\NET\+NET\addAssembly.m
Error in speech (line 11) NET.addAssembly('System.Speech');
this error comes when write code of convert to speech why ?

  0 Comments

Sign in to comment.



Translated by