Editor's Note: This file was selected as MATLAB Central Pick of the Week
TTS text to speech.
TTS (TXT) synthesizes speech from string TXT, and speaks it. The audio format is mono, 16 bit, 16k Hz by default.
WAV = TTS(TXT) does not vocalize but output to the variable WAV.
TTS(TXT,VOICE) uses the specific voice. Use TTS('','List') to see a list of availble voices. Default is the first voice.
TTS(...,PACE) set the pace of speech to PACE. PACE ranges from -10 (slowest) to 10 (fastest). Default 0.
TTS(...,FS) set the sampling rate of the speech to FS kHz. FS must be one of the following: 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000. Default 16.
This function requires the Mirosoft Win32 Speech API (SAPI).
Examples:
% Speak the text;
tts('I can speak.');
% List availble voices;
tts('I can speak.','List');
% Do not speak out, store the speech in a variable;
w = tts('I can speak.',[],-4,44100);
wavplay(w,44100);
Siyi Deng (2021). text-to-speech (https://www.mathworks.com/matlabcentral/fileexchange/18091-text-to-speech), MATLAB Central File Exchange. Retrieved .
Inspired by: tts version 1.0
Inspired: Sudoku Solver with Computer Voice, Number to Myriad, Number to Words, TACTICS Toolbox, Interval workout timer
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Any chance I can talk you in to putting this on GitHub so I can make a couple PRs to it?
how can i store that computer voice?
perfect
That is brilliant!!!
For text to speech app, use "Text speaker". I use it to listen to my text documents. The natural, human sounding voices are excellent. It's easy to create mp3 audio file from the text.
https://www.deskshare.com/text-to-speech-software.aspx
when using this function to read a long text is there a way to interrupt it so that it doesn't continue reading all the remaining text?
Very cool indeed
Very nice job. Thank you very much.
how to convert tamil text to eng?
Excellent.thank you very much
good program very clear output
but i got a question ?
how do i store this mp3 file
nice
how to add voice option
??
Ho to add new language to list ??? I need to get polish languages.
Excellent, thank you, works perfectly. Here is the code I used to create a nice compressed .ogg audio file:
% List availble voices;
tts('I can speak.','List');
% Use one of the voices from the list
w = tts('1, 2, 3, 4, 5','Microsoft Zira Desktop - English (United States)',0,44100);
% Save the data as a compressed .ogg audio file
audiowrite('C:\Test.ogg',w,44100);
@ Friends / Mr. SAI PRATHAP REDDY KATHI..Can you please tell me "How you are taking input from the text file "??
pl help
Thank you very much. I take a variable to read text from .txt and i give this variable tts function it working. thank you
Excellent.thanks
How do I get more speech profiles? I only have microsoft anna...
awesome work sir. excellent..thanks sir
hi, can you explain me how exactly text is converted to speech
because i have taken this as my project but i m not getting function tts that how it converts text to speech signal
salam
i want to send text file as an input and speech as out put in matlab...
plz help me out
goood work
nice work its really helpful to me...
nice