text2speech

Automatic text-to-speech synthesis
2.2K Downloads
Updated 21 Dec 2025

View License

Convert text into human-like speech in a variety of voices and languages.
This entry enables you to synthesize strings into sampled speech recordings available as MATLAB vectors using a single function call.
You will need a license of Audio Toolbox, an internet connection, and an active subscription to a text-to-speech service of your choice – Google™ Cloud Speech-to-Text API, IBM™ Watson Speech to Text API, Microsoft™ Azure Speech Services API, or Amazon™ Polly.
See the Examples tab for detailed instructions on how to get started.
See also:

Cite As

MathWorks Audio Toolbox Team (2025). text2speech (https://www.mathworks.com/matlabcentral/fileexchange/73326-text2speech), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2026a
Compatible with R2022b and later releases
Platform Compatibility
Windows macOS Linux
Categories
Find more on Audio I/O and Waveform Generation in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!

speechclients/setup

speechclients/examples

Version Published Release Notes
1.0.15

Bug fix when used with text2speech and SpeechBrain support package.

1.0.14

Removed HTTPTimeOut as option of text2speech. Specify TimeOut on client object. Improved error messages.

1.0.13

Added example. Fix to default voice to support new API keys.

1.0.12

Bug fix for 24a release. Supporting new syntax.

1.0.11

re-architected for better source control

1.0.10

Fix for toolbox installs (path issue).

1.0.9

Removed en folder from path.

1.0.8

Added support for Amazon Polly.

1.0.7

- updated description

1.0.6

Improved command-line help for speechClient.

1.0.5

Updated speechClient to work with R2022b support for wav2vec 2.0

1.0.4

Fixed file location

1.0.3

Reacted to change in IBM url

1.0.2

Fixed error in Microsoft client

1.0.1

Added link to speech2text

1.0.0