{"id":11876,"date":"2018-09-04T18:32:52","date_gmt":"2018-09-04T16:32:52","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=11876"},"modified":"2022-03-16T18:48:06","modified_gmt":"2022-03-16T17:48:06","slug":"kostenlose-mp3-dateien-mit-inhalt-0-bis-1000-fuer-die-ansage-in-deutsch-mit-voicerss-com-und-id3v2","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=11876","title":{"rendered":"Kostenlose mp3 Dateien mit Inhalt 0 bis 1000 f\u00fcr die Ansage in deutsch mit voicerss.com und id3v2."},"content":{"rendered":"<p>F\u00fcr ein Homeautomatisations Projekt mit Raspberry Pi, brauchte ich mp3 Dateien f\u00fcr die Ansage. Damit alles lokal l\u00e4uft, und ich nicht die mp3 Dateien per Web jedesmal erzeugen bzw. laden muss, habe ich mal eben 1000 mp3 Dateien erzeugt. Jede mit dem jeweiligen Inhalt bzw. Ansage in deutsch in Mono mit 44khz in 16bit mit der Zahl aus dem Dateinamen. Jede Datei ist nur so um die 25 Kb gro\u00df. <\/p>\n<p>Also alle Zahlen von 0 &#8211; 1000. Das Ergebnis ist hier nun kostenlos zum Downloaden in einer gezippten Datei <a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/mp3-1-1000.zip\">mp3-1-1000.zip (14,8 MB)<\/a>.<\/p>\n<p>Hier eine H\u00f6rprobe der 777.mp3 Datei:<br \/>\n<audio class=\"wp-audio-shortcode\" id=\"audio-11876-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/777.mp3?_=1\" \/><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/777.mp3\">http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/777.mp3<\/a><\/audio><\/p>\n<p>Mit diesen Dateien, kann nun leicht eine Ansage von Systemdaten bzw. Temperaturen oder Flugdaten erfolgen.<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Sprachsynthese.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Sprachsynthese-1024x580.png\" alt=\"\" width=\"525\" height=\"297\" class=\"aligncenter size-large wp-image-11887\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Sprachsynthese-1024x580.png 1024w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Sprachsynthese-300x170.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Sprachsynthese-768x435.png 768w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><\/p>\n<p>Wie habe ich die nun alle erzeugt?<\/p>\n<p>Mit der folgenden JUnit Methode:<\/p>\n<pre class=\"lang:java decode:true \" >\r\n@Test\r\nvoid textToMp3Text1000() {\r\n\r\ntry {\r\n\tfor (int i = 0; i &lt; 1001; i++) {\r\n\t\tKonvert.textToMp3(API_KEY, i + \".mp3\", \"\" + i);\r\n\t}\r\n\t} catch (Exception e) {\r\n\t        System.err.println(\"Error: \" + e.getMessage());\r\n\t}\r\n}\r\n<\/pre>\n<p>Hier die Konvert.java Klasse:<!--more--><\/p>\n<pre class=\"lang:java decode:true \" >package de.wenzlaff.sound;\r\n\r\nimport java.io.FileOutputStream;\r\n\r\nimport com.voicerss.tts.AudioCodec;\r\nimport com.voicerss.tts.AudioFormat;\r\nimport com.voicerss.tts.Languages;\r\nimport com.voicerss.tts.VoiceParameters;\r\nimport com.voicerss.tts.VoiceProvider;\r\n\r\n\/**\r\n * Beispiel f\u00fcr Text to MP3 Datei.\r\n * \r\n * Lib Download von http:\/\/www.voicerss.org\/sdk\/java.aspx\r\n * \r\n * @author Thomas Wenzlaff\r\n *\r\n *\/\r\npublic class Konvert {\r\n\r\n\t\/**\r\n\t * Methode erstellt eine MP3 Datei aus dem Text\r\n\t * \r\n\t * @param text      der Inhalt der MP3 Datei\r\n\t * @param dateiname der Name der MP3 Datei\r\n\t * @throws Exception bei Fehler\r\n\t *\/\r\n\tpublic static void textToMp3(String key, String dateiname, String text) throws Exception {\r\n\t\tVoiceProvider tts = new VoiceProvider(key);\r\n\r\n\t\tVoiceParameters params = new VoiceParameters(text, Languages.German);\r\n\t\tparams.setCodec(AudioCodec.MP3);\r\n\t\tparams.setFormat(AudioFormat.Format_44KHZ.AF_44khz_16bit_mono);\r\n\t\tparams.setBase64(false);\r\n\t\tparams.setSSML(false);\r\n\t\tparams.setRate(0);\r\n\r\n\t\tbyte[] voice = tts.speech(params);\r\n\r\n\t\tFileOutputStream fos = new FileOutputStream(dateiname);\r\n\t\tfos.write(voice, 0, voice.length);\r\n\t\tfos.flush();\r\n\t\tfos.close();\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>F\u00fcr die Umwandlung und das SDK habe ich den <a href=\"https:\/\/www.voicerss.org\/\/\" rel=\"noopener\" target=\"_blank\">kostenlosen Service<\/a> verwendet, wie auch <a href=\"http:\/\/blog.wenzlaff.de\/?p=11863\" rel=\"noopener\" target=\"_blank\">hier<\/a> schon mal beschrieben<\/p>\n<p>Anschlie\u00dfend, habe ich noch alle Dateien mit meinem Script getaggt:<\/p>\n<pre class=\"lang:sh decode:true \" >#!\/bin\/bash\r\n#\r\n# Thomas Wenzlaff\r\n#\r\n# Das Script tag-mp3-files.sh zum Taggen von mp3 Dateien im .\/mp3 Verzeichnis.\r\n#\r\n#\r\ncd .\/mp3 || exit\r\n\r\necho \"Tagge alle .\/mp3\/*.mp3 Dateien.\"\r\n\r\nfor i in *.mp3 ; do\r\n dateiname=$(echo \"${i}\" | sed 's\/.mp3$\/\/')\r\n echo \"${i}\"\r\n id3v2 -t \"Ansage der Zahl $dateiname\" -T \"1\" -A \"wenzlaff.de\" -a \"Thomas Wenzlaff\" -y \"2018\" -c \"$dateiname\" -g 39 \"${i}\"\r\ndone<\/pre>\n<p>Daf\u00fcr muss auf dem Raspberry Pi das id3v2 Programm installiert sein. Das kann leicht mit<\/p>\n<pre class=\"lang:default decode:true \" >\r\n\r\nsudo apt-get install id3v2\r\n\r\n<\/pre>\n<p>durchgef\u00fcrt werden. Mit dem k\u00f6nnen die Tags f\u00fcr die mp3 Dateien wie folgt gesetzt werden, wie die man Page zeigt:<\/p>\n<pre class=\"lang:default decode:true \" >\r\nID3V2(1)                                                   User Command                                                  ID3V2(1)\r\n\r\nNAME\r\n       id3v2 -  Adds\/Modifies\/Removes\/Views id3v2 tags, converts\/lists id3v1 tags\r\n\r\nSYNOPSIS\r\n       id3v2 [ OPTION ] [ FILE ]\r\n\r\nOPTIONS\r\n       -h, --help\r\n              Display help and exit\r\n\r\n       -f, --list-frames\r\n              Display all possible frames for id3v2\r\n\r\n       -L, --list-genres\r\n              Lists all id3v1 genres\r\n\r\n       -v, --version\r\n              Display version information and exit\r\n\r\n       -l, --list\r\n              Lists the tag(s) on the file(s)\r\n\r\n       -R, --list-rfc822\r\n              Lists using an rfc822-style format for output\r\n\r\n       -d, --delete-v2\r\n              Deletes id3v2 tags\r\n\r\n       -s, --delete-v1\r\n              Deletes id3v1 tags\r\n\r\n       -D, --delete-all\r\n               Deletes both id3v1 and id3v2 tags\r\n\r\n       -C, --convert\r\n               Converts id3v1 tag to id3v2\r\n\r\n       -a, --artist ARTIST\r\n              Set the artist information\r\n\r\n       -A, --album ALBUM\r\n              Set the album title information\r\n\r\n       -t, --song SONG\r\n              Set the song title information\r\n\r\n       -c, --comment DESCRIPTION:COMMENT\r\n              Set the comment information\r\n\r\n       -g, --genre num\r\n              Set the genre number\r\n\r\n       -y, --year num\r\n              Set the year\r\n\r\n       -T, --track num\/num\r\n              Set the track number\/(optional) total tracks\r\n\r\nNOTE\r\n       You can set the value for any id3v2 frame by using '--' and then frame id\r\n\r\n       For example:\r\n\r\n              id3v2 --TIT3 Monkey! file.mp3\r\n\r\n       would set the \"Subtitle\/Description\" frame to \"Monkey!\".\r\n<\/pre>\n<p>Mit dem Programm kann man auch leicht die Metainfos abfragen. Z.B. mit <strong>id3v2 -l 777.mp3<\/strong> f\u00fcr die mp3 Datei 777.mp3 von oben:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.14.24.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.14.24.png\" alt=\"\" width=\"819\" height=\"330\" class=\"aligncenter size-full wp-image-11882\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.14.24.png 819w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.14.24-300x121.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.14.24-768x309.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Oder in iTunes:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.16.45.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.16.45.png\" alt=\"\" width=\"1371\" height=\"516\" class=\"aligncenter size-full wp-image-11883\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.16.45.png 1371w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.16.45-300x113.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.16.45-768x289.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.16.45-1024x385.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>mit ein paar Details: <\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.17.39.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.17.39.png\" alt=\"\" width=\"718\" height=\"682\" class=\"aligncenter size-full wp-image-11884\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.17.39.png 718w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.17.39-300x285.png 300w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/a><\/p>\n<p>und infos \u00fcber die Datei: <\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.18.01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.18.01.png\" alt=\"\" width=\"718\" height=\"436\" class=\"aligncenter size-full wp-image-11885\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.18.01.png 718w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/09\/Bildschirmfoto-2018-09-04-um-20.18.01-300x182.png 300w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>F\u00fcr ein Homeautomatisations Projekt mit Raspberry Pi, brauchte ich mp3 Dateien f\u00fcr die Ansage. Damit alles lokal l\u00e4uft, und ich nicht die mp3 Dateien per Web jedesmal erzeugen bzw. laden muss, habe ich mal eben 1000 mp3 Dateien erzeugt. Jede mit dem jeweiligen Inhalt bzw. Ansage in deutsch in Mono mit 44khz in 16bit mit &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=11876\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eKostenlose mp3 Dateien mit Inhalt 0 bis 1000 f\u00fcr die Ansage in deutsch mit voicerss.com und id3v2.\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[220,852,808,1023,1,7],"tags":[3363,1787,3387],"class_list":["post-11876","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-heimautomatisierung","category-linux-2","category-raspberry-pi","category-uncategorized","category-tools","tag-deutsch","tag-mp3","tag-voice"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/11876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11876"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/11876\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11876"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}