{"id":7,"date":"2021-06-26T23:28:38","date_gmt":"2021-06-26T21:28:38","guid":{"rendered":"https:\/\/automatiseer.eu\/?p=7"},"modified":"2021-06-26T23:40:02","modified_gmt":"2021-06-26T21:40:02","slug":"amazon-alexa-play-mp3-in-home-assistant","status":"publish","type":"post","link":"https:\/\/automatiseer.eu\/index.php\/2021\/06\/26\/amazon-alexa-play-mp3-in-home-assistant\/","title":{"rendered":"Amazon Alexa: play MP3 in Home Assistant"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Playing a MP3 using a Amazon Alexa (Dot\/Echo) device can be somewhat troublesome.<br>Therefore this quick howto.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Requirements :<br>A website that has SSL with an official certificate (not Letsencrypt and not a self signed one)<br>One or more MP3 files that are saved as 48k with a constant bitrate and joint stereo.<br>With <a href=\"https:\/\/www.audacityteam.org\/\">Audacity <\/a>the save options should look like this.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"559\" height=\"594\" src=\"https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/afbeelding-1.png\" alt=\"\" class=\"wp-image-9\" srcset=\"https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/afbeelding-1.png 559w, https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/afbeelding-1-282x300.png 282w, https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/afbeelding-1-141x150.png 141w, https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/afbeelding-1-300x319.png 300w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">With <a href=\"https:\/\/www.ffmpeg.org\/\">FFmpeg <\/a>you should convert your MP3 with the following command:<br>ffmpeg -i -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000<br>Or you can convert the MP3 online <a href=\"https:\/\/www.jovo.tech\/audio-converter\">HERE<\/a><br>Next, upload the converted MP3 to the website and check if you can open it with your browser.<br> <\/p>\n\n\n<p>Now with Home Assistant you can test it by going to Developer Tools \/ Services and in the &#8220;Service&#8221; field enter notify.alexa_media<br>In the &#8220;Message&#8221; field enter : &lt;audio src=&#8217;https:\/\/automatiseer.eu\/audio\/kleine-wasjes-grote-wasjes.mp3&#8217;\/&gt; (change the mp3 to your mp3 or use this one for testing)<br>Now put the check-mark before &#8220;Target&#8221; and in the Target Field enter the name of your echo device (i.e. media_player.echo_dot)<br>Now check-mark the &#8220;Data&#8221; and in the field enter: <br>type: tts<\/p>\n<p>So eventually it should look something like this.<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"968\" height=\"376\" src=\"https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/Screenshot-Developer-Tools-Home-Assistant.png\" alt=\"\" class=\"wp-image-10\" srcset=\"https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/Screenshot-Developer-Tools-Home-Assistant.png 968w, https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/Screenshot-Developer-Tools-Home-Assistant-300x117.png 300w, https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/Screenshot-Developer-Tools-Home-Assistant-768x298.png 768w, https:\/\/automatiseer.eu\/wp-content\/uploads\/2021\/06\/Screenshot-Developer-Tools-Home-Assistant-150x58.png 150w\" sizes=\"auto, (max-width: 968px) 100vw, 968px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now hit the &#8220;Call Service&#8221; button to test it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Playing a MP3 using a Amazon Alexa (Dot\/Echo) device can be somewhat troublesome.Therefore this quick howto. Requirements :A website that has SSL with an official certificate (not Letsencrypt and not a self signed one)One or more MP3 files that are saved as 48k with a constant bitrate and joint stereo.With Audacity the save options should ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/automatiseer.eu\/index.php\/2021\/06\/26\/amazon-alexa-play-mp3-in-home-assistant\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-7","post","type-post","status-publish","format-standard","hentry","category-alexa"],"_links":{"self":[{"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":4,"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":15,"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/posts\/7\/revisions\/15"}],"wp:attachment":[{"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/automatiseer.eu\/index.php\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}