{"id":1100,"date":"2024-03-18T15:42:13","date_gmt":"2024-03-18T15:42:13","guid":{"rendered":"https:\/\/thomas.w-p.me.uk\/blog\/?p=1100"},"modified":"2024-03-18T15:45:04","modified_gmt":"2024-03-18T15:45:04","slug":"upsampling-with-squeezelite","status":"publish","type":"post","link":"https:\/\/thomas.w-p.me.uk\/blog\/2024\/03\/upsampling-with-squeezelite\/","title":{"rendered":"Upsampling with squeezelite"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I had Text-To-Speech (TTW) working really well with squeezelite and <a href=\"https:\/\/www.home-assistant.io\/\">Home Assistant<\/a> on a <a href=\"https:\/\/www.raspberrypi.com\/\">Raspberry Pi <\/a>3B with max2play (which now looks sadly defunct). I thought I would pep things up a bit and use a RPi4 elsewhere as a Speaker for HA so my music was not constantly destroyed. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Getting squeezelite to work was easy but could I get TTS to work? The mp3 file was created but squeezelite looped when trying to play it. Sad times.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I worked out that it played fine when the sample speed was increased and in all my searching hit upon the concept of &#8220;Upsampling&#8221;. Hmmm. Since I had originally used &#8220;apt get install sqeezelite -y&#8221; and found it hard to find any settings at all and had not yet really understood docker I took this opportunity to move to a docker setup. Happily one of the settings allowed the magic &#8220;Eq&#8221; that got things rolling along.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#FAFAFA\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"version: &quot;3&quot;\n\nservices:\n  squeezelite-my-usb-dac:\n    image: giof71\/squeezelite:latest\n    container_name: squeezelite\n    devices:\n      - \/dev\/snd:\/dev\/snd\n    environment:\n      - SQUEEZELITE_AUDIO_DEVICE=&quot;hdmi:CARD=vc4hdmi1,DEV=0&quot;\n      - SQUEEZELITE_NAME=&quot;Kitchen Panel&quot;\n      - SQUEEZELITE_SERVER_PORT=192.168.0.60\n      - SQUEEZELITE_LOG_CATEGORY_ALL\n      - SQUEEZELITE_MAC_ADDRESS=&quot;45:07:31:83:01:40&quot;\n      - DISPLAY_PRESETS=Y\n      - SQUEEZELITE_PARAMS=&quot;80:4::&quot;\n      - SQUEEZELITE_UPSAMPLING=&quot;Eq&quot;\n    restart: unless-stopped\" style=\"color:#90A4AE;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-lighter\" style=\"background-color: #FAFAFA\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E2931D\">version<\/span><span style=\"color: #39ADB5\">:<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #39ADB5\">&quot;<\/span><span style=\"color: #91B859\">3<\/span><span style=\"color: #39ADB5\">&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #E2931D\">services<\/span><span style=\"color: #39ADB5\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">  squeezelite<\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\">my<\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\">usb<\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #E2931D\">dac<\/span><span style=\"color: #39ADB5\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #E2931D\">image<\/span><span style=\"color: #39ADB5\">:<\/span><span style=\"color: #90A4AE\"> giof71<\/span><span style=\"color: #39ADB5\">\/<\/span><span style=\"color: #E2931D\">squeezelite<\/span><span style=\"color: #39ADB5\">:<\/span><span style=\"color: #90A4AE\">latest<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #E2931D\">container_name<\/span><span style=\"color: #39ADB5\">:<\/span><span style=\"color: #90A4AE\"> squeezelite<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #E2931D\">devices<\/span><span style=\"color: #39ADB5\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">      <\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #39ADB5\">\/<\/span><span style=\"color: #90A4AE\">dev<\/span><span style=\"color: #39ADB5\">\/<\/span><span style=\"color: #E2931D\">snd<\/span><span style=\"color: #39ADB5\">:\/<\/span><span style=\"color: #90A4AE\">dev<\/span><span style=\"color: #39ADB5\">\/<\/span><span style=\"color: #90A4AE\">snd<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #E2931D\">environment<\/span><span style=\"color: #39ADB5\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">      <\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\"> SQUEEZELITE_AUDIO_DEVICE<\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #39ADB5\">&quot;<\/span><span style=\"color: #91B859\">hdmi:CARD=vc4hdmi1,DEV=0<\/span><span style=\"color: #39ADB5\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">      <\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\"> SQUEEZELITE_NAME<\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #39ADB5\">&quot;<\/span><span style=\"color: #91B859\">Kitchen Panel<\/span><span style=\"color: #39ADB5\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">      <\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\"> SQUEEZELITE_SERVER_PORT<\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #F76D47\">192.168<\/span><span style=\"color: #39ADB5\">.<\/span><span style=\"color: #F76D47\">0.60<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">      <\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\"> SQUEEZELITE_LOG_CATEGORY_ALL<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">      <\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\"> SQUEEZELITE_MAC_ADDRESS<\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #39ADB5\">&quot;<\/span><span style=\"color: #91B859\">45:07:31:83:01:40<\/span><span style=\"color: #39ADB5\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">      <\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\"> DISPLAY_PRESETS<\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #90A4AE\">Y<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">      <\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\"> SQUEEZELITE_PARAMS<\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #39ADB5\">&quot;<\/span><span style=\"color: #91B859\">80:4::<\/span><span style=\"color: #39ADB5\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">      <\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\"> SQUEEZELITE_UPSAMPLING<\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #39ADB5\">&quot;<\/span><span style=\"color: #91B859\">Eq<\/span><span style=\"color: #39ADB5\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #E2931D\">restart<\/span><span style=\"color: #39ADB5\">:<\/span><span style=\"color: #90A4AE\"> unless<\/span><span style=\"color: #39ADB5\">-<\/span><span style=\"color: #90A4AE\">stopped<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I had Text-To-Speech (TTW) working really well with squeezelite and Home Assistant on a Raspberry Pi 3B with max2play (which now looks sadly defunct). I thought I would pep things up a bit and use a RPi4 elsewhere as a Speaker for HA so my music was not constantly destroyed. Getting squeezelite to work was &hellip; <a href=\"https:\/\/thomas.w-p.me.uk\/blog\/2024\/03\/upsampling-with-squeezelite\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Upsampling with squeezelite<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[110,108,112,111],"tags":[],"class_list":["post-1100","post","type-post","status-publish","format-standard","hentry","category-docker","category-home-assistant","category-logitech-media-server-lms","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/1100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/comments?post=1100"}],"version-history":[{"count":1,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/1100\/revisions"}],"predecessor-version":[{"id":1101,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/1100\/revisions\/1101"}],"wp:attachment":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=1100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=1100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=1100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}