Thursday, December 4, 2025

ESP32 Speech Function: Text to Speech

EFY Tested

Speech capability in technology primarily has two dimensions: text to speech (TTS) and speech to text (STT). This ESP32 Text-to-Speech device focuses on TTS. Here, the MAX98357A amplifier is used with the MCU ESP32 development board, and Google API is used to convert the text into speech.

The cost-effective MAX98357A I2S amplifier (mono) is connected to the ESP32. Although stereo models like the UDA1334A are available, the mono version is chosen for simplicity. The I2S amplifier uses three GPIO pins, which can be any pins except for 34 and 35 (input-only pins).

POC Video

A 4-ohm speaker is connected to the output, and it is essential to verify the board specifications. The speaker’s ‘+’ and ‘-’ terminals must be connected correctly to avoid distortion. The author’s prototype is shown in Fig. 1, and the necessary components are listed in the Bill of Materials table.

- Advertisement -
ESP32 Text-to-Speech with MAX98357A
Fig. 1: ESP32 Text to Speech with MAX98357A
Bill of Materials
ComponentsQuantity
ESP32 node MCU (MOD1)1
3-watt speaker1
MAX98357A I2S 3-watt Class D amplifier1
5V USB power supply cable1

ESP32 Text to Speech – Circuit Diagram

EFY Icon

Sorry! You cannot read this post further, as this is for EFY PRIME subscribers only.

EFY PRIME subscribers get access to our BEST content, in an AD-free environment for readers who value faster and clutter-free reading experience.

- Advertisement -

If you're already an EFY PRIME subscriber, please login below. Else, please make a small investment by
CLICKING HERE and upgrade your level to access this and many more of such content.

4 COMMENTS

  1. Please show the snippet where the code is not working. Otherwise one basic check is remove the positive power supply to the MAX98357A and upload the code. Ensure all the libraries are available for the ESP32.

SHARE YOUR THOUGHTS & COMMENTS

Somnath Bera
Somnath Bera
Somnath Bera combines industrial leadership in thermal power systems with expertise in electronics, IoT, AI, and embedded systems. Through his prolific contributions to EFY, plus public demos and tutorials, he empowers both hobbyists and professionals with practical, impactful projects. His work reflects a rare blend of deep technical knowledge and hands-on innovation aimed at solving real-world problems.
×