{"id":4461,"date":"2022-02-20T11:57:06","date_gmt":"2022-02-20T10:57:06","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=4461"},"modified":"2022-02-20T17:41:12","modified_gmt":"2022-02-20T16:41:12","slug":"tts-with-pre-recorded-audio-preparing-the-audio-files","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/","title":{"rendered":"TTS with Pre-Recorded Audio: Preparing the Audio Files"},"content":{"rendered":"<p>I the <a href=\"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/16\/tts-with-prerecorded-audio-building-a-talking-clock\/\">last Blog<\/a> I introduced you to my new <a href=\"https:\/\/github.com\/pschatzmann\/arduino-simple-tts\">Simple TTS<\/a> Arduino Library which is available on Github.<\/p>\n<p>I used the Text-to-Speech (TTS) functionality of <strong>Google Translate<\/strong> to generate the mp3 files, which was quite tedious to do manually. Then I executed xxd to generate a .h file from an mp3 recording with:<\/p>\n<pre><code>xxd -i mp3file.mp3 header-file.h\n<\/code><\/pre>\n<p>The header files are then made available with the logic that can be found in <a href=\"https:\/\/github.com\/pschatzmann\/arduino-simple-tts\/blob\/main\/src\/AudioDictionary.h\">AudioDictionary.h<\/a><\/p>\n<h3>Tools<\/h3>\n<p>You can prepare <strong>your own audio data<\/strong> easily with the help of a CSV file. Details can be found in the <a href=\"https:\/\/github.com\/pschatzmann\/arduino-simple-tts\/blob\/main\/tools\/README.ipynb\">Jupyter Notebook<\/a> in the tools directory of the project.<\/p>\n<h3>CSV File Format<\/h3>\n<p>The input CSV file has the following format:<\/p>\n<pre><code>Name, Text\nzero, zero\none, one\ntwo, two\nthree, three\nfour, four\nfive, five\nsix, six\n@menu1, Hallo this is the main menu\n...\n<\/code><\/pre>\n<p>The first field is used to identify the audio information and to generate the file name and is <strong>case insensitive<\/strong>. This value is passed as key to the audio generation class. Please note that you should only use a short name w\/o special characters because this will be used as file name on a SD drive!<br \/>\nThe second field is used as input to generate the audio file.<br \/>\nUsually both values are the same. However you could decide to record some long text under a short name. In this case we recommend to start the name with a @ character.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I the last Blog I introduced you to my new Simple TTS Arduino Library which is available on Github. I used the Text-to-Speech (TTS) functionality of Google Translate to generate the mp3 files, which was quite tedious to do manually. Then I executed xxd to generate a .h file from [&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-4461","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>TTS with Pre-Recorded Audio: Preparing the Audio Files - 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\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TTS with Pre-Recorded Audio: Preparing the Audio Files - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"I the last Blog I introduced you to my new Simple TTS Arduino Library which is available on Github. I used the Text-to-Speech (TTS) functionality of Google Translate to generate the mp3 files, which was quite tedious to do manually. Then I executed xxd to generate a .h file from [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-20T10:57:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-20T16:41:12+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\\\/2022\\\/02\\\/20\\\/tts-with-pre-recorded-audio-preparing-the-audio-files\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/02\\\/20\\\/tts-with-pre-recorded-audio-preparing-the-audio-files\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"TTS with Pre-Recorded Audio: Preparing the Audio Files\",\"datePublished\":\"2022-02-20T10:57:06+00:00\",\"dateModified\":\"2022-02-20T16:41:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/02\\\/20\\\/tts-with-pre-recorded-audio-preparing-the-audio-files\\\/\"},\"wordCount\":221,\"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\\\/2022\\\/02\\\/20\\\/tts-with-pre-recorded-audio-preparing-the-audio-files\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/02\\\/20\\\/tts-with-pre-recorded-audio-preparing-the-audio-files\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/02\\\/20\\\/tts-with-pre-recorded-audio-preparing-the-audio-files\\\/\",\"name\":\"TTS with Pre-Recorded Audio: Preparing the Audio Files - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"datePublished\":\"2022-02-20T10:57:06+00:00\",\"dateModified\":\"2022-02-20T16:41:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/02\\\/20\\\/tts-with-pre-recorded-audio-preparing-the-audio-files\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/02\\\/20\\\/tts-with-pre-recorded-audio-preparing-the-audio-files\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/02\\\/20\\\/tts-with-pre-recorded-audio-preparing-the-audio-files\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TTS with Pre-Recorded Audio: Preparing the Audio Files\"}]},{\"@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":"TTS with Pre-Recorded Audio: Preparing the Audio Files - 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\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/","og_locale":"en_US","og_type":"article","og_title":"TTS with Pre-Recorded Audio: Preparing the Audio Files - Phil Schatzmann","og_description":"I the last Blog I introduced you to my new Simple TTS Arduino Library which is available on Github. I used the Text-to-Speech (TTS) functionality of Google Translate to generate the mp3 files, which was quite tedious to do manually. Then I executed xxd to generate a .h file from [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/","og_site_name":"Phil Schatzmann","article_published_time":"2022-02-20T10:57:06+00:00","article_modified_time":"2022-02-20T16:41:12+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\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"TTS with Pre-Recorded Audio: Preparing the Audio Files","datePublished":"2022-02-20T10:57:06+00:00","dateModified":"2022-02-20T16:41:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/"},"wordCount":221,"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\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/","url":"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/","name":"TTS with Pre-Recorded Audio: Preparing the Audio Files - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"datePublished":"2022-02-20T10:57:06+00:00","dateModified":"2022-02-20T16:41:12+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/02\/20\/tts-with-pre-recorded-audio-preparing-the-audio-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"TTS with Pre-Recorded Audio: Preparing the Audio Files"}]},{"@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\/4461","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=4461"}],"version-history":[{"count":14,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/4461\/revisions"}],"predecessor-version":[{"id":4476,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/4461\/revisions\/4476"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=4461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=4461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=4461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}