{"id":150416,"date":"2024-11-01T13:04:47","date_gmt":"2024-11-01T07:34:47","guid":{"rendered":"https:\/\/www.electronicsforu.com\/?p=150416"},"modified":"2025-01-21T16:18:31","modified_gmt":"2025-01-21T10:48:31","slug":"esp32-text-to-speech","status":"publish","type":"post","link":"https:\/\/www.electronicsforu.com\/electronics-projects\/esp32-text-to-speech","title":{"rendered":"ESP32 Speech Function: Text to Speech"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"178\" height=\"163\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/07\/efy-tested-1.jpg\" alt=\"EFY Tested\" class=\"wp-image-143513\"\/><\/figure><\/div>\n\n\n<p>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.<\/p>\n\n\n\n<p>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). <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">POC Video<\/h2>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"8VPJsTAmWUfBawKjgZ4iL\"><iframe loading=\"lazy\" title=\"Turn Text into Speech with ESP32: Build a Talking Gadget Using Google TTS | Electronics For You\" width=\"696\" height=\"392\" src=\"https:\/\/www.youtube.com\/embed\/2hZxbnJh6FQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/span>\n<\/div><\/figure>\n\n\n\n<p>A 4-ohm speaker is connected to the output, and it is essential to verify the board specifications. The speaker\u2019s \u2018+\u2019 and \u2018-\u2019 terminals must be connected correctly to avoid distortion. The author\u2019s prototype is shown in Fig. 1, and the necessary components are listed in the Bill of Materials table.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"481\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/10\/Authors-prototype-1.jpg\" alt=\"ESP32 Text-to-Speech with MAX98357A\" class=\"wp-image-150418\" style=\"width:525px;height:auto\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/10\/Authors-prototype-1.jpg 800w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/10\/Authors-prototype-1-500x301.jpg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/10\/Authors-prototype-1-699x420.jpg 699w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/10\/Authors-prototype-1-696x418.jpg 696w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Fig. 1: ESP32 Text to Speech with MAX98357A<\/figcaption><\/figure><\/div>\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td colspan=\"2\"><strong>Bill of Materials<\/strong><\/td><\/tr><tr><td><strong>Components<\/strong><\/td><td><strong>Quantity<\/strong><\/td><\/tr><tr><td>ESP32 node MCU (MOD1)<\/td><td>1<\/td><\/tr><tr><td>3-watt speaker<\/td><td>1<\/td><\/tr><tr><td>MAX98357A I2S 3-watt Class D amplifier<\/td><td>1<\/td><\/tr><tr><td>5V USB power supply cable<\/td><td>1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>ESP32 Text to Speech &#8211; Circuit Diagram<\/strong><\/h2>\n\n\n\n<div class=\"mepr_error\"><div class=\"prime-members\">\n<h4><strong>OOPS! THIS IS EFY PRIME CONTENT...<br \/>\n<\/strong><span style=\"color: #333333;font-family: Verdana, BlinkMacSystemFont, -apple-system, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-size: 14px\">which means that you need to be an EFY PRIME subscriber to read it.<\/span><\/h4>\n<p>EFY PRIME content is our best content. Hence, you need to make a small investment to access all of our content including EFY Prime content.<\/p>\n<p>If you're already an EFY PRIME member, feel free to login below.<\/p>\n<p>Else, <strong><a href=\"https:\/\/www.electronicsforu.com\/plans\/efy-prime-subscription-plans\" target=\"_blank\" rel=\"noopener\">CLICK HERE<\/a><\/strong> to invest in an EFY Prime account and become our VIP customer who can access all our content, and that too without the clutter of ads!<\/p>\n<p>BENEFITS OF EFY PRIME MEMBERSHIP:<br \/>\n(1) Zero Clutter AD free experience<br \/>\n(2) Super-fast user experience<br \/>\n(3) Focussed reading experience with no distractions<br \/>\n(4) Access to all our content including our Best-of-Best which is EFY Prime\n<\/p><\/div>\n<\/div><div>\n<div class=\"mp_wrapper mp_login_form\">\n                  <!-- mp-login-form-start -->     <form name=\"mepr_loginform\" id=\"mepr_loginform\" class=\"mepr-form\" action=\"https:\/\/www.electronicsforu.com\/login\" method=\"post\">\n            <div class=\"mp-form-row mepr_username\">\n        <div class=\"mp-form-label\">\n                              <label for=\"user_login\">Username<\/label>\n        <\/div>\n        <input type=\"text\" name=\"log\" id=\"user_login\" value=\"\" \/>\n      <\/div>\n      <div class=\"mp-form-row mepr_password\">\n        <div class=\"mp-form-label\">\n          <label for=\"user_pass\">Password<\/label>\n          <div class=\"mp-hide-pw\">\n            <input type=\"password\" name=\"pwd\" id=\"user_pass\" value=\"\" \/>\n            <button type=\"button\" class=\"button mp-hide-pw hide-if-no-js\" data-toggle=\"0\" aria-label=\"Show password\">\n              <span class=\"dashicons dashicons-visibility\" aria-hidden=\"true\"><\/span>\n            <\/button>\n          <\/div>\n        <\/div>\n      <\/div>\n            <div>\n        <label><input name=\"rememberme\" type=\"checkbox\" id=\"rememberme\" value=\"forever\" \/> Remember Me<\/label>\n      <\/div>\n      <div class=\"mp-spacer\">&nbsp;<\/div>\n      <div class=\"submit\">\n        <input type=\"submit\" name=\"wp-submit\" id=\"wp-submit\" class=\"button-primary mepr-share-button \" value=\"Log In\" \/>\n        <input type=\"hidden\" name=\"redirect_to\" value=\"\/wp-json\/wp\/v2\/posts\/150416\" \/>\n        <input type=\"hidden\" name=\"mepr_process_login_form\" value=\"true\" \/>\n        <input type=\"hidden\" name=\"mepr_is_login_page\" value=\"false\" \/>\n      <\/div>\n    <\/form>\n    <div class=\"mp-spacer\">&nbsp;<\/div>\n    <div class=\"mepr-login-actions\">\n      <a href=\"https:\/\/www.electronicsforu.com\/login?action=forgot_password\">Forgot Password<\/a>\n    <\/div>\n\n      \n    <!-- mp-login-form-end --> \n  <\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":116810,"featured_media":150959,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,23,6070,6072,11962,6189],"tags":[1985,110,1921,12155],"class_list":{"0":"post-150416","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-electronics-projects","8":"category-hardware-diy","9":"category-advanced-projects","10":"category-beginners-projects","11":"category-efy-prime","12":"category-esp32-projects","13":"tag-diy-projects","14":"tag-electronics-projects","15":"tag-esp32","16":"tag-nov-2024"},"_links":{"self":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/150416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/users\/116810"}],"replies":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/comments?post=150416"}],"version-history":[{"count":2,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/150416\/revisions"}],"predecessor-version":[{"id":156345,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/150416\/revisions\/156345"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media\/150959"}],"wp:attachment":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media?parent=150416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/categories?post=150416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/tags?post=150416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}