{"id":3945,"date":"2021-12-08T10:03:10","date_gmt":"2021-12-08T09:03:10","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=3945"},"modified":"2023-02-19T16:17:11","modified_gmt":"2023-02-19T15:17:11","slug":"using-flite-with-the-ai-thinker-audio-kit","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/","title":{"rendered":"Using the FLITE TTS Engine with the AI Thinker Audio Kit"},"content":{"rendered":"<p>As you might know from my <a href=\"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/06\/the-ai-thinker-audio-kit-experience-or-nothing-is-right\/\">last posts<\/a> I am currently extending my <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">Arduino Audio Tools<\/a> library to support the <a href=\"https:\/\/docs.ai-thinker.com\/en\/esp32-audio-kit\">AI Thinker Audio Kit<\/a> which is based on the ES8388 audio chip.<br \/>\n.<\/p>\n<p>I thought it might be helpful to have a &#8216;Text to Speech&#8217; example for the <a href=\"https:\/\/docs.ai-thinker.com\/en\/esp32-audio-kit\">Audio Kit<\/a>. In this example I am using <a href=\"https:\/\/github.com\/pschatzmann\/arduino-flite\">FLITE<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/pschatzmann.github.io\/Resources\/img\/audio-toolkit.png\" alt=\"Audio Kit\" \/><\/p>\n<h3>The Arduino Sketch<\/h3>\n<pre><code>#include \"flite_arduino.h\"\n#include \"AudioTools.h\"\n#include \"AudioDevices\/ESP32AudioKit\/AudioKit.h\"\n\nusing namespace audio_tools;\n\nAudioKitStream kit;\nFlite flite(kit);\n\nconst char* alice = \"Hallo my name is FLITE\";\n\nvoid setup(){\n  Serial.begin(115200);\n\n  auto cfg = kit.defaultConfig();\n  cfg.bits_per_sample = 16;\n  cfg.channels = 1;\n  cfg.sample_rate = 8000;\n  kit.begin(cfg);\n\n  flite.say(alice);\n}\n\nvoid loop() {\n}\n\n<\/code><\/pre>\n<p>When we define <code>Flite<\/code>, we assign the kit as output stream. Then we need to define the proper I2S parameters that Flite is expecting in the setup method! The audio autput is started by calling the <code>say<\/code> method.<\/p>\n<h3>Dependencies<\/h3>\n<p>You need to install the following libraries:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-flite\">FLITE<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">Arduino Audio Tolls<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-audiokit\">AudioKit<\/a><\/li>\n<\/ul>\n<h3>Source Code<\/h3>\n<p>The <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/tree\/main\/examples\/examples-audiokit\/streams-flite-audiokit\">source code for this example<\/a> can also be found on Github. Please note that this example was working at the time of publishing. If you want to try it out please use this (potentially updated) example.<\/p>\n<h3>Dependencies<\/h3>\n<p>You need to install the following libraries:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-flite\">FLITE<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">Arduino Audio Tolls<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>As you might know from my last posts I am currently extending my Arduino Audio Tools library to support the AI Thinker Audio Kit which is based on the ES8388 audio chip. . I thought it might be helpful to have a &#8216;Text to Speech&#8217; example for the Audio Kit. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3946,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[20,22,35],"tags":[28,27],"class_list":["post-3945","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-machine-sound","category-text-to-speech","tag-esp32audiokit","tag-tts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using the FLITE TTS Engine with the AI Thinker Audio Kit - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using the FLITE TTS Engine with the AI Thinker Audio Kit - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"As you might know from my last posts I am currently extending my Arduino Audio Tools library to support the AI Thinker Audio Kit which is based on the ES8388 audio chip. . I thought it might be helpful to have a &#8216;Text to Speech&#8217; example for the Audio Kit. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-08T09:03:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-19T15:17:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/12\/flite.png\" \/>\n\t<meta property=\"og:image:width\" content=\"220\" \/>\n\t<meta property=\"og:image:height\" content=\"220\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Using the FLITE TTS Engine with the AI Thinker Audio Kit\",\"datePublished\":\"2021-12-08T09:03:10+00:00\",\"dateModified\":\"2023-02-19T15:17:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/\"},\"wordCount\":171,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/flite.png\",\"keywords\":[\"ESP32AudioKit\",\"TTS\"],\"articleSection\":[\"Arduino\",\"Machine Sound\",\"Text To Speech\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/\",\"name\":\"Using the FLITE TTS Engine with the AI Thinker Audio Kit - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/flite.png\",\"datePublished\":\"2021-12-08T09:03:10+00:00\",\"dateModified\":\"2023-02-19T15:17:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/flite.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/flite.png\",\"width\":220,\"height\":220},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/12\\\/08\\\/using-flite-with-the-ai-thinker-audio-kit\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using the FLITE TTS Engine with the AI Thinker Audio Kit\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using the FLITE TTS Engine with the AI Thinker Audio Kit - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/","og_locale":"en_US","og_type":"article","og_title":"Using the FLITE TTS Engine with the AI Thinker Audio Kit - Phil Schatzmann","og_description":"As you might know from my last posts I am currently extending my Arduino Audio Tools library to support the AI Thinker Audio Kit which is based on the ES8388 audio chip. . I thought it might be helpful to have a &#8216;Text to Speech&#8217; example for the Audio Kit. [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/","og_site_name":"Phil Schatzmann","article_published_time":"2021-12-08T09:03:10+00:00","article_modified_time":"2023-02-19T15:17:11+00:00","og_image":[{"width":220,"height":220,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/12\/flite.png","type":"image\/png"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Using the FLITE TTS Engine with the AI Thinker Audio Kit","datePublished":"2021-12-08T09:03:10+00:00","dateModified":"2023-02-19T15:17:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/"},"wordCount":171,"commentCount":3,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/12\/flite.png","keywords":["ESP32AudioKit","TTS"],"articleSection":["Arduino","Machine Sound","Text To Speech"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/","url":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/","name":"Using the FLITE TTS Engine with the AI Thinker Audio Kit - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/12\/flite.png","datePublished":"2021-12-08T09:03:10+00:00","dateModified":"2023-02-19T15:17:11+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/12\/flite.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/12\/flite.png","width":220,"height":220},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/12\/08\/using-flite-with-the-ai-thinker-audio-kit\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Using the FLITE TTS Engine with the AI Thinker Audio Kit"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=3945"}],"version-history":[{"count":17,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3945\/revisions"}],"predecessor-version":[{"id":5385,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3945\/revisions\/5385"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/3946"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=3945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=3945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=3945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}