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

@@ -15,15 +15,28 @@ set -u
# ── Konfiguration lesen ───────────────────────────────────────────────────────
DEVICE_NAME=$(bashio::config 'device_name')
BITRATE=$(bashio::config 'bitrate')
STREAM_FORMAT=$(bashio::config 'stream_format')
STREAM_PORT=$(bashio::config 'stream_port')
STREAM_MOUNT=$(bashio::config 'stream_mount')
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 "║ Busch-Radio Spotify Bridge v1.0.0 ║"
bashio::log.info "║ Busch-Radio Spotify Bridge v1.0.9 ║"
bashio::log.info "╚══════════════════════════════════════════════╝"
bashio::log.info "Gerätename : ${DEVICE_NAME}"
bashio::log.info "Bitrate : ${BITRATE} kbps"
bashio::log.info "Format : ${STREAM_FORMAT}"
bashio::log.info "Stream-Port : ${STREAM_PORT}"
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-description>Spotify via Home Assistant</stream-description>
<bitrate>${BITRATE}</bitrate>
<type>audio/mpeg</type>
<type>${ICECAST_MIME}</type>
</mount>
<fileserve>1</fileserve>
@@ -199,7 +212,7 @@ ICECAST_SOURCE_URL="icecast://source:${ICECAST_PASSWORD}@localhost:${STREAM_PORT
# ── Stream-URL ausgeben ───────────────────────────────────────────────────────
bashio::log.info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
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 "Icecast-Statusseite:"
bashio::log.info " http://<homeassistant-ip>:${STREAM_PORT}"
@@ -239,10 +252,9 @@ while true; do
-loglevel warning \
-f s16le -ar 44100 -ac 2 \
-i pipe:0 \
-codec:a libmp3lame \
-codec:a "${FFMPEG_CODEC}" \
-b:a "${BITRATE}k" \
-q:a 2 \
-f mp3 \
-f "${FFMPEG_FORMAT}" \
"${ICECAST_SOURCE_URL}" \
|| true