{"id":3204,"date":"2021-06-23T04:38:27","date_gmt":"2021-06-23T02:38:27","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=3204"},"modified":"2022-02-16T19:44:55","modified_gmt":"2022-02-16T18:44:55","slug":"text-to-speach-in-arduino-using-flite","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/","title":{"rendered":"Text To Speach in Arduino using Flite"},"content":{"rendered":"<p>In my last Blogs I looked at <a href=\"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/22\/text-to-speach-in-arduino\/\">SAM<\/a> and <a href=\"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/22\/text-to-speach-in-arduino\/\">Arduino\/TTS<\/a>. I was putting high hopes in <a href=\"https:\/\/github.com\/festvox\/flite\">CMU Flite<\/a>:<\/p>\n<p><strong>CMU Flite<\/strong> (festival-lite) is a small, fast run-time open source text to speech synthesis engine developed at CMU and primarily designed for small embedded machines and\/or large servers. Flite is designed as an alternative text to speech synthesis engine to Festival for voices built using the FestVox suite of voice building tools.<\/p>\n<p>I was extending the project as well to provide a simple API and added some additional output scenarios, so that I could receive the data as stream: <a href=\"https:\/\/github.com\/pschatzmann\/arduino-Flite\">My extended project can be found on Github<\/a>.<\/p>\n<p>Like for SAM and TTS, <strong>the Arduino<\/strong> sketch for the <strong>Webserver<\/strong> is equally small (by using my <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">arduino-audio-tools <\/a>):<\/p>\n<pre><code>#include \"flite_arduino.h\"\n#include \"AudioServer.h\"\n\nusing namespace audio_tools;  \n\nAudioWAVServer server(\"ssid\",\"password\");\n\n\/\/ Callback which provides the audio data \nvoid outputData(Stream &amp;out){\n  Serial.print(\"providing data...\");\n  Flite flite(out);\n  flite.say(\"Hallo, my name is Alice\");\n}\n\nvoid setup(){\n  Serial.begin(115200);\n  \/\/ start data sink\n  server.begin(outputData, 8000,1,16);\n}\n\n\n\/\/ Arduino loop  \nvoid loop() {\n  \/\/ Handle new connections\n  server.doLoop();  \n}\n<\/code><\/pre>\n<p>I did not get disappointed &#8211; this is so far the best voice quality:<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-3204-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/wav\" src=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/06\/flite.wav?_=1\" \/><a href=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/06\/flite.wav\">https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/06\/flite.wav<\/a><\/audio>\n<p>But it comes at the cost of the size:<\/p>\n<pre><code>Sketch uses 2730326 bytes (86%) of program storage space. Maximum is 3145728 bytes.\nGlobal variables use 38956 bytes (11%) of dynamic memory, leaving 288724 bytes for local variables. Maximum is 327680 bytes.\n<\/code><\/pre>\n<p>This might be just at the edge for an ESP32 but it is already too much for a Rasperry Pico&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last Blogs I looked at SAM and Arduino\/TTS. I was putting high hopes in CMU Flite: CMU Flite (festival-lite) is a small, fast run-time open source text to speech synthesis engine developed at CMU and primarily designed for small embedded machines and\/or large servers. Flite is designed as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"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":[27],"class_list":["post-3204","post","type-post","status-publish","format-standard","hentry","category-arduino","category-machine-sound","category-text-to-speech","tag-tts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Text To Speach in Arduino using Flite - 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\/06\/23\/text-to-speach-in-arduino-using-flite\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Text To Speach in Arduino using Flite - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"In my last Blogs I looked at SAM and Arduino\/TTS. I was putting high hopes in CMU Flite: CMU Flite (festival-lite) is a small, fast run-time open source text to speech synthesis engine developed at CMU and primarily designed for small embedded machines and\/or large servers. Flite is designed as [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-23T02:38:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-16T18:44:55+00:00\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/06\\\/23\\\/text-to-speach-in-arduino-using-flite\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/06\\\/23\\\/text-to-speach-in-arduino-using-flite\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Text To Speach in Arduino using Flite\",\"datePublished\":\"2021-06-23T02:38:27+00:00\",\"dateModified\":\"2022-02-16T18:44:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/06\\\/23\\\/text-to-speach-in-arduino-using-flite\\\/\"},\"wordCount\":186,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"keywords\":[\"TTS\"],\"articleSection\":[\"Arduino\",\"Machine Sound\",\"Text To Speech\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/06\\\/23\\\/text-to-speach-in-arduino-using-flite\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/06\\\/23\\\/text-to-speach-in-arduino-using-flite\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/06\\\/23\\\/text-to-speach-in-arduino-using-flite\\\/\",\"name\":\"Text To Speach in Arduino using Flite - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"datePublished\":\"2021-06-23T02:38:27+00:00\",\"dateModified\":\"2022-02-16T18:44:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/06\\\/23\\\/text-to-speach-in-arduino-using-flite\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/06\\\/23\\\/text-to-speach-in-arduino-using-flite\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/06\\\/23\\\/text-to-speach-in-arduino-using-flite\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Text To Speach in Arduino using Flite\"}]},{\"@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":"Text To Speach in Arduino using Flite - 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\/06\/23\/text-to-speach-in-arduino-using-flite\/","og_locale":"en_US","og_type":"article","og_title":"Text To Speach in Arduino using Flite - Phil Schatzmann","og_description":"In my last Blogs I looked at SAM and Arduino\/TTS. I was putting high hopes in CMU Flite: CMU Flite (festival-lite) is a small, fast run-time open source text to speech synthesis engine developed at CMU and primarily designed for small embedded machines and\/or large servers. Flite is designed as [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/","og_site_name":"Phil Schatzmann","article_published_time":"2021-06-23T02:38:27+00:00","article_modified_time":"2022-02-16T18:44:55+00:00","author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Text To Speach in Arduino using Flite","datePublished":"2021-06-23T02:38:27+00:00","dateModified":"2022-02-16T18:44:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/"},"wordCount":186,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"keywords":["TTS"],"articleSection":["Arduino","Machine Sound","Text To Speech"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/","url":"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/","name":"Text To Speach in Arduino using Flite - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"datePublished":"2021-06-23T02:38:27+00:00","dateModified":"2022-02-16T18:44:55+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/06\/23\/text-to-speach-in-arduino-using-flite\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Text To Speach in Arduino using Flite"}]},{"@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\/3204","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=3204"}],"version-history":[{"count":17,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3204\/revisions"}],"predecessor-version":[{"id":3278,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3204\/revisions\/3278"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=3204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=3204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=3204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}