Hello everyone can anyone pls tell me matlab code for text to speech synthesis without using system speech synthesizer...pls help me...

 採用された回答

Image Analyst
Image Analyst 2014 年 10 月 18 日

7 投票

Try this, if you have a Windows computer:
% 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);

25 件のコメント

Shenbagalakshmi Veliah
Shenbagalakshmi Veliah 2014 年 10 月 20 日
Thank u very much for ur answer
Image Analyst
Image Analyst 2014 年 10 月 20 日
If this works, could you go ahead and mark the answer as "Accepted". Thanks in advance.
Jan
Jan 2014 年 10 月 20 日
But System.Speech uses the systems speech synthesizer.
Image Analyst
Image Analyst 2014 年 10 月 20 日
Right - I didn't notice because of slight wording differences. I wonder why it matters. Who cares as long as your computer talks?
Mamadou  Ndir
Mamadou Ndir 2015 年 7 月 28 日
hello Image Analyst I work in a project and you helped me now is that I can know what code type for the spectrum and the timing of the signal ?
Image Analyst
Image Analyst 2015 年 7 月 28 日
I don't understand your question. Ask it in your own brand new question after reading this.
Ashish Shinde
Ashish Shinde 2016 年 5 月 2 日
Image Analyst, wow man you solved my problem. I thot I was in a tight jam. But your code just made my day...Kudos.
Image Analyst
Image Analyst 2016 年 5 月 2 日
You're quite welcome Ashish. Thanks for your vote.
shilpa dandwani
shilpa dandwani 2017 年 7 月 30 日
Please help me in install speech synthesizer for window 7 for smooth work
Walter Roberson
Walter Roberson 2017 年 7 月 30 日
Which speech synthesizer?
Deba Choudhury
Deba Choudhury 2017 年 8 月 27 日
How is the code working?
m k
m k 2017 年 10 月 29 日
I want to read text from notepad file or .txt file what the code for it? |
Image Analyst
Image Analyst 2017 年 10 月 29 日
Look at the help for fgetl()
% Open the file.
fileID = fopen(fullFileName, 'rt');
% Read the first line of the file.
textLine = fgetl(fileID);
while ischar(textLine)
% Read the remaining lines of the file.
fprintf('%s\n', textLine);
% Read the next line.
textLine = fgetl(fileID);
end
% All done reading all lines, so close the file.
fclose(fileID);
m k
m k 2017 年 10 月 31 日
Thanks for code but i want read text from notepad and convert that text into speech
Walter Roberson
Walter Roberson 2017 年 10 月 31 日
m k: do you mean that you want the MATLAB program to reach over to an active copy of Notepad and ask Notepad to give it the content of the text?
I am having difficulty determining whether Notepad permits that kind of manipulation at all. I am finding information on connecting from MATLAB to Notepad++ which is an open source enhancement of Notepad.
Marek
Marek 2018 年 3 月 7 日
How can I change the voice using this solution? The obj.Voice.Name property seem to be read-only. I want to use some other voice (supplied by IVONA), not the default.
taha khan
taha khan 2018 年 4 月 25 日
編集済み: taha khan 2018 年 4 月 25 日
Error using NET.addAssembly Attempt to execute SCRIPT addAssembly as a function: C:\Program Files\MATLAB\R2017a\toolbox\matlab\winfun\NET\+NET\addAssembly.m
when i write above code then this error begins?? any one known why?
Vamshi Krishna R
Vamshi Krishna R 2018 年 11 月 3 日
you must use matlab version higher then 4.1
Walter Roberson
Walter Roberson 2018 年 11 月 3 日
? There was no public MATLAB 4.1. The public releases went from 4.0 (1992) to 4.2c (1994)
Vinay Vinay
Vinay Vinay 2019 年 11 月 8 日
I got the same error as "error in NET.addAssembly('System.Speech'); Can you tell me what did you do and what I should do to rectify the error and for output
NISTALA
NISTALA 2020 年 2 月 27 日
編集済み: NISTALA 2020 年 2 月 27 日
can we save the audio output in a file or folder
Image Analyst
Image Analyst 2020 年 2 月 27 日
To use audiowrite() you'd need to check what properties or methods System.Speech or obj has. Perhaps one of them is a function to return the audio waveform.
Basma Maher
Basma Maher 2020 年 6 月 2 日
How can i save the audio output in a file.wav?
Image Analyst
Image Analyst 2020 年 6 月 2 日
The very first example in the help for audiowrite() shows you how to do that:
load handel.mat
filename = 'handel.wav';
audiowrite(filename,y,Fs);
You just have to make sure your filename extension has the correct extension to save it in whatever format you want, and audiowrite() will figure it out.
Mohamed
Mohamed 2020 年 7 月 6 日
how can i store that computer voice on my computer?

サインインしてコメントする。

その他の回答 (6 件)

Pertor
Pertor 2016 年 5 月 27 日
編集済み: Image Analyst 2016 年 5 月 27 日

0 投票

Perhaps this website may be useful. Though I don't get it.
Deba Choudhury
Deba Choudhury 2017 年 8 月 27 日

0 投票

It would quite a help if you explain the code working.

3 件のコメント

Walter Roberson
Walter Roberson 2017 年 8 月 27 日
If you are referring to Image Analyst's code: it works by activating a .NET assembly, creating a .NET object using the assembly, and invoking a method on object to do the work.
Another way of phrasing this is that it more or less makes an operating system call to do the work.
The technique will work only for MS Windows.
Vinay Vinay
Vinay Vinay 2019 年 11 月 8 日

Can you please tell me code for the process you have told..creating .Net and invoking it

Image Analyst
Image Analyst 2019 年 11 月 8 日
You don't need to do anything. In my code you simply start using NET.
With Windows systems, it's built-in or something.

サインインしてコメントする。

sadiq husaini
sadiq husaini 2017 年 10 月 14 日

0 投票

Need the source code of this class (System.Speech.Synthesis.SpeechSynthesizer)? any one help me ? thanks in advance.

2 件のコメント

Image Analyst
Image Analyst 2017 年 10 月 14 日
If you get hired onto the right team, you may be able to get to the source code.
Jan
Jan 2017 年 10 月 14 日
@sadiq: You ask a Matlab forum to provide the source code of a Windows library, which is obviously a protected property of Microsoft. Seriously?

サインインしてコメントする。

soundarya sopna
soundarya sopna 2018 年 2 月 17 日

0 投票

i need coding for extact of text and audio conversion

2 件のコメント

Image Analyst
Image Analyst 2018 年 2 月 17 日
sneha madre
sneha madre 2018 年 2 月 22 日
how to reduce delay in text to speech conversion between two word or more in matlab .please send command.thanks

サインインしてコメントする。

Priya Raj
Priya Raj 2018 年 3 月 21 日

0 投票

Sir, We have obtained the count of objects in our program and we want to output that count in the form of speech,How it can be done,ty.
Brian Hemmat
Brian Hemmat 2020 年 1 月 25 日

0 投票

Audio Toolbox (R2019a or later) supports calling into popular 3rd-party APIs for speech synthesis:

カテゴリ

ヘルプ センター および File ExchangeSimulation, Tuning, and Visualization についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by