repo: music
action: commit
revision: 
path_from: 
revision_from: b58c72e863dcbbd2ce797af6bfc4611b4905e3ca:
path_to: 
revision_to: 
git.thebackupbox.net
music
git clone git://git.thebackupbox.net/music
commit b58c72e863dcbbd2ce797af6bfc4611b4905e3ca
Author: epoch 
Date:   Sat Nov 13 01:58:42 2021 +0000

    switched to new tilderadio uri. create the /run/music dir before attempting to use it. mess of stuff to try to get proper title set at the same time the stream starts.. or shortly after. added a lame flag.

diff --git a/music-push b/music-push
index b122eb2ab156250c907e00df9c98337cfc134b8c..
index ..5e8d151e39977b9319e37652f3245217d218c6ab 100755
--- a/music-push
+++ b/music-push
@@ -1,7 +1,7 @@
 #!/bin/bash

 ### this is the default because this is the server I push to sometimes.
-uri="${1:-http://radio.tildeverse.org:8005/}"
+uri="${1:-http://azuracast.tilderadio.org:8005/}"

 ### if you don't have these tools installed, you'll want to edit these assignments manually
 which secret-tool >/dev/null && creds="$(secret-tool lookup "${uri}" "${uri}")" || creds="default-username:default-password"
@@ -22,6 +22,7 @@ pass="$(printf "%s\n" "$creds" | cut -d: -f2)"
 ### not as portable. :/ but this is what I used first.
 ##( printf "username: %s\npassword: %s\n" "$user" "$pass" ; printf "%s\n" "${uri}" | uricut ) | urijoin > "${PREFIX}/run/music/pushuri"

+mkdir -p "${PREFIX}/run/music"
 printf "http://%s:%s@%s:%s/\n" "$user" "$pass" "$domain" "$port" > "${PREFIX}/run/music/pushuri"

 host="$domain:$port"
@@ -29,8 +30,22 @@ host="$domain:$port"
 ### while this is going, I need to find a way to add a hook to the music-setnowplaying
 (sleep 10;music-updateplaying )&

+printf "SOURCE / HTTP/1.1\r
+Host: %s\r
+Content-Type: audio/mpeg\r
+Authorization: Basic %s\r
+Ice-Public: 0\r
+Ice-Name: mic check\r
+Ice-Description: epoch is testing stuff\r
+Ice-URL: file:///dev/null\r
+Ice-Genre: wat\r
+\r
+" "$host" "$(printf "%s\n" "$creds" |base64)" | ncat "$domain" "$port"
+
+music-pushmeta -f 'a LARP of an internet radio DJ'
+
 music-record \
-  | stdbuf -o0 lame - -r -s 44.1 -b 128 \
+  | stdbuf -o0 lame - -r --noreplaygain -s 44.1 -b 128 \
   | cat <(printf \
 "SOURCE / HTTP/1.1\r
 Host: %s\r
@@ -42,4 +57,6 @@ Ice-Description: epoch is testing stuff\r
 Ice-URL: file:///dev/null\r
 Ice-Genre: wat\r
 \r
-" "$host" "$(printf "%s\n" "$creds" | base64)") /dev/stdin | ncat "${domain}" "${port}"
+" "$host" "$(printf "%s\n" "$creds" | base64)") /dev/stdin | ncat "${domain}" "${port}" >&2
+
+xmessage "done pushing music."

-----END OF PAGE-----