File Exchange

image thumbnail

text-to-speech

version 1.0 (2.05 KB) by

text-to-speech, speech synthesis, tts, let Matlab speak

4.46667
15 Ratings

70 Downloads

Updated

View License

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);

Comments and Ratings (22)

Very cool indeed

Dogba Djaze

Very nice job. Thank you very much.

amala david

how to convert tamil text to eng?

David Lo

gammone

Excellent.thank you very much

prince garg

good program very clear output
but i got a question ?
how do i store this mp3 file

Pratik Oak

nice
how to add voice option
??

Ho to add new language to list ??? I need to get polish languages.

lee

lee (view profile)

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

Mihir Phatak

Excellent.thanks

Cedric

Cedric (view profile)

How do I get more speech profiles? I only have microsoft anna...

Pardeep Singh

awesome work sir. excellent..thanks sir

milan

milan (view profile)

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

Surya

Surya (view profile)

zee nisa

salam
i want to send text file as an input and speech as out put in matlab...
plz help me out

Sidra

Sidra (view profile)

goood work

vikas patel

nice work its really helpful to me...

gghh www

nice

nikhil ekka

MATLAB Release
MATLAB 7.4 (R2007a)

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video