Feature: AAC-Support und Bitrate auf Radiomaximum angepasst

Busch-Radio iNet 8216 U unterstützt max. 192 kbps und die Formate
MP3, AAC und OGG. Neue Konfigurationsoptionen:
- stream_format: mp3 (Standard) oder aac
- bitrate: 96/128/160/192 kbps (max. des Radios)

Default auf 160 kbps MP3 geändert (war 320 kbps – über Radio-Maximum).
Stream-URL im Log zeigt jetzt die echte HA-IP statt Platzhalter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Niklas Gühne
2026-04-07 08:55:14 +02:00
parent bc5f734be4
commit ecd90f08f4
2 changed files with 24 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ slug: busch_radio_spotify
description: > description: >
Streamt Spotify-Musik als Internet-Radio-Stream für das Busch-Jäger Unterputz-Internetradio. Streamt Spotify-Musik als Internet-Radio-Stream für das Busch-Jäger Unterputz-Internetradio.
Das Add-on erzeugt ein virtuelles Spotify Connect-Gerät (via librespot) und stellt das Audio Das Add-on erzeugt ein virtuelles Spotify Connect-Gerät (via librespot) und stellt das Audio
als MP3-Stream über Icecast bereit. als MP3- oder AAC-Stream über Icecast bereit.
url: "https://gitea.bitfire.work/retr0/Busch-Radio-Spotify" url: "https://gitea.bitfire.work/retr0/Busch-Radio-Spotify"
arch: arch:
- aarch64 - aarch64
@@ -22,14 +22,16 @@ host_network: true
# ---- Konfigurationsoptionen ---- # ---- Konfigurationsoptionen ----
options: options:
device_name: "Busch-Radio" device_name: "Busch-Radio"
bitrate: 320 bitrate: 160
stream_format: "mp3"
stream_port: 8000 stream_port: 8000
stream_mount: "/stream.mp3" stream_mount: "/stream"
icecast_password: "busch-radio-geheim" icecast_password: "busch-radio-geheim"
schema: schema:
device_name: str device_name: str
bitrate: "list(96|160|320)" bitrate: "list(96|128|160|192)"
stream_format: "list(mp3|aac)"
stream_port: port stream_port: port
stream_mount: str stream_mount: str
icecast_password: str icecast_password: str

View File

@@ -15,15 +15,28 @@ set -u
# ── Konfiguration lesen ─────────────────────────────────────────────────────── # ── Konfiguration lesen ───────────────────────────────────────────────────────
DEVICE_NAME=$(bashio::config 'device_name') DEVICE_NAME=$(bashio::config 'device_name')
BITRATE=$(bashio::config 'bitrate') BITRATE=$(bashio::config 'bitrate')
STREAM_FORMAT=$(bashio::config 'stream_format')
STREAM_PORT=$(bashio::config 'stream_port') STREAM_PORT=$(bashio::config 'stream_port')
STREAM_MOUNT=$(bashio::config 'stream_mount') STREAM_MOUNT=$(bashio::config 'stream_mount')
ICECAST_PASSWORD=$(bashio::config 'icecast_password') ICECAST_PASSWORD=$(bashio::config 'icecast_password')
# ── Format-spezifische Einstellungen ──────────────────────────────────────────
if [ "${STREAM_FORMAT}" = "aac" ]; then
FFMPEG_CODEC="aac"
FFMPEG_FORMAT="adts"
ICECAST_MIME="audio/aac"
else
FFMPEG_CODEC="libmp3lame"
FFMPEG_FORMAT="mp3"
ICECAST_MIME="audio/mpeg"
fi
bashio::log.info "╔══════════════════════════════════════════════╗" bashio::log.info "╔══════════════════════════════════════════════╗"
bashio::log.info "║ Busch-Radio Spotify Bridge v1.0.0 ║" bashio::log.info "║ Busch-Radio Spotify Bridge v1.0.9 ║"
bashio::log.info "╚══════════════════════════════════════════════╝" bashio::log.info "╚══════════════════════════════════════════════╝"
bashio::log.info "Gerätename : ${DEVICE_NAME}" bashio::log.info "Gerätename : ${DEVICE_NAME}"
bashio::log.info "Bitrate : ${BITRATE} kbps" bashio::log.info "Bitrate : ${BITRATE} kbps"
bashio::log.info "Format : ${STREAM_FORMAT}"
bashio::log.info "Stream-Port : ${STREAM_PORT}" bashio::log.info "Stream-Port : ${STREAM_PORT}"
bashio::log.info "Stream-Pfad : ${STREAM_MOUNT}" bashio::log.info "Stream-Pfad : ${STREAM_MOUNT}"
@@ -88,7 +101,7 @@ cat > /tmp/busch-radio/icecast.xml <<ICECAST_EOF
<stream-name>Busch-Radio Spotify Bridge</stream-name> <stream-name>Busch-Radio Spotify Bridge</stream-name>
<stream-description>Spotify via Home Assistant</stream-description> <stream-description>Spotify via Home Assistant</stream-description>
<bitrate>${BITRATE}</bitrate> <bitrate>${BITRATE}</bitrate>
<type>audio/mpeg</type> <type>${ICECAST_MIME}</type>
</mount> </mount>
<fileserve>1</fileserve> <fileserve>1</fileserve>
@@ -199,7 +212,7 @@ ICECAST_SOURCE_URL="icecast://source:${ICECAST_PASSWORD}@localhost:${STREAM_PORT
# ── Stream-URL ausgeben ─────────────────────────────────────────────────────── # ── Stream-URL ausgeben ───────────────────────────────────────────────────────
bashio::log.info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" bashio::log.info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
bashio::log.info "Stream-URL für das Busch-Jäger Radio:" bashio::log.info "Stream-URL für das Busch-Jäger Radio:"
bashio::log.info " http://<homeassistant-ip>:${STREAM_PORT}${STREAM_MOUNT}" bashio::log.info " http://${HA_IP}:${STREAM_PORT}${STREAM_MOUNT}"
bashio::log.info "" bashio::log.info ""
bashio::log.info "Icecast-Statusseite:" bashio::log.info "Icecast-Statusseite:"
bashio::log.info " http://<homeassistant-ip>:${STREAM_PORT}" bashio::log.info " http://<homeassistant-ip>:${STREAM_PORT}"
@@ -239,10 +252,9 @@ while true; do
-loglevel warning \ -loglevel warning \
-f s16le -ar 44100 -ac 2 \ -f s16le -ar 44100 -ac 2 \
-i pipe:0 \ -i pipe:0 \
-codec:a libmp3lame \ -codec:a "${FFMPEG_CODEC}" \
-b:a "${BITRATE}k" \ -b:a "${BITRATE}k" \
-q:a 2 \ -f "${FFMPEG_FORMAT}" \
-f mp3 \
"${ICECAST_SOURCE_URL}" \ "${ICECAST_SOURCE_URL}" \
|| true || true