Squeezy wrote: 
> Ich höre oft den Sender "GotRadio Alternative Rock". Der blendet als
> Song Title "Advertisment" ein, sobald Werbung kommt. An Hand dieses
> Titles ist also einfach zu erkennen, ob Werbung kommt oder nicht. 
> 
> Man muss nicht alles selber machen. Daher:
> 
> Gibt es bereits ein PlugIn oder einen CLI-Skript, der so etwas auswertet
> (gerne auch für andere Sender und Erkennungsmethoden) und dann z.B. die
> Lautstärke auf 0 dimmt und am Ende wieder restauriert?


Code:
--------------------
    
  #!/bin/bash
  
  which nc6 &>/dev/null || { echo "no netcat6 found"; exit 1; }
  
  LMS=lmsserver
  TRIGGER="Advertisment " 
  DEBUG=
  
  declare -A plStat
  declare -A plMute
  
  while true; do 
        psAR=( `echo "players 0 99"|nc6 -q1 $LMS 9090  2>/dev/null` )
        for i in "${psAR[@]}"; do
                if [[ $i == "playerid"* ]]; then
                        PLID=${i/playerid%3A/}
                fi
                if [[ $i == "connected%3A"* ]]; then
                        CS=${i/connected%3A/}
                        [ $DEBUG ] && echo "P: $PLID CS: $CS"
  
                        if [ $CS -eq 1 ]; then
                                CSONG="`echo "$PLID current_title ?"|nc6 -q1 
$LMS 9090  2>/dev/null|sed -e "s/$PLID current_title //"` "
                                [ $DEBUG ] && echo -n "P: [$PLID] CSONG: 
[$CSONG] (old: [${plStat[$PLID]}] ): "
                                if [ -n "${plStat[$PLID]}" ] && [ 
"${plStat[$PLID]}" == "$CSONG" ]; then
                                        [ $DEBUG ] && echo "unchanged"
                                else
                                        [ $DEBUG ] && echo "changed"
                                        if [[ $CSONG == "$TRIGGER" ]]; then
                                                [ $DEBUG ] && echo "match 
trigger -> mute"
                                                plMute["$PLID"]=1;
                                                echo "$PLID mixer muting"|nc6 
--send-only $LMS 9090 &>/dev/null
                                        else
                                                if [ -n "${plMute[$PLID]}" ] && 
[ "${plMute[$PLID]}" -eq "1" ]; then
                                                        VOL=`echo "$PLID mixer 
volume ?"|nc6 -q1 $LMS 9090  2>/dev/null|sed -e "s/$PLID mixer volume //"`
                                                        [ $DEBUG ] && echo 
"mute on -> unmute (vol=$VOL)"
                                                        plMute["$PLID"]=0;
                                                        echo "$PLID mixer 
muting"|nc6 --send-only $LMS 9090 &>/dev/null
                                                        echo "$PLID mixer 
volume $VOL"|nc6 --send-only $LMS 9090 &>/dev/null
                                                fi
                                        fi
                                fi
                                plStat["$PLID"]=$CSONG;
                        fi
  
                fi
        done
        sleep 2
  done
  
  
--------------------

- LMS und TRIGGER anpassen
- benötigt netcat6



SW: extGUI4LMS - new web UI: 'forum'
(http://forums.slimdevices.com/showthread.php?98186-Announce-Alternative-Web-Interface-(beta))
/ 'homepage' (https://www.nexus0.net/pub/sw/extgui4lms/) | 'LMSlib2go'
(http://forums.slimdevices.com/showthread.php?107704-Announce-LMSlib2go-library-information-on-mobile-devices)
| 'music visualizer'
(http://forums.slimdevices.com/showthread.php?103073-Announce-music-visualizer-for-squeezelite)
for squeezelite
HowTos: 'build a self-contained LMS'
(http://forums.slimdevices.com/showthread.php?99648-Howto-build-a-self-contained-LMS)
| 'Ogg Opus support'
(http://forums.slimdevices.com/showthread.php?107011-Howto-play-Ogg-Opus-files)
| 'Bluetooth with ALSA'
(http://forums.slimdevices.com/showthread.php?107230-Howto-Bluetooth-streaming-to-from-LMS-(ALSA-only-no-PulseAudio))
| ' update bundled perl modules'
(http://forums.slimdevices.com/showthread.php?107040-Howto-update-perl-modules-bundled-with-LMS)
------------------------------------------------------------------------
Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=107846

_______________________________________________
slimserver-de mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/slimserver-de

Antwort per Email an