Synthesize speech from text
synthesizes a speech signal from the provided text.
fs] = text2speech(
interfaces with third-party speech services (Google®, IBM®, or Microsoft®) to perform the synthesis.
text2speech, you must download the extended Audio Toolbox™ functionality from File Exchange. The File Exchange submission includes a tutorial to get started
with the third-party services.
Synthesize Speech from Text
speechClient object that interfaces with the IBM Watson Text to Speech service.
synthesizer = speechClient("IBM");
text2speech with a string to synthesize a speech signal.
[speech,fs] = text2speech(synthesizer,"hello world");
Listen to the synthesized speech.
clientObj — Client object
Client object, specified as an object returned by
speechClient. The object is an interface to a third-party speech
You cannot use
text2speech with a
object that interfaces with the wav2vec 2.0 pretrained model.
To use the third-party speech services, you must download the extended Audio Toolbox functionality from File Exchange. The File Exchange submission includes a tutorial to get started with the third-party services.
text — Text
string | character array
Text to synthesize into speech, specified as a string or character array.
Example: "Hello world"
timeout — Time to wait for server connection in seconds
10 (default) | positive scalar
Time to wait for initial server connection in seconds, specified as a positive scalar.
speech — Synthesized speech
Synthesized speech signal, returned as a column vector (single channel).
fs — Sample rate (Hz)
Sample rate of speech signal in Hz, returned as a positive double. The sample rate
depends on the third-party service and its properties set through the
See the documentation for the specific speech service for more information.
Introduced in R2022b