1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Effect when music is playing

Discussion in 'Hyperion General' started by sylvaing26, 28 January 2019.

  1. sylvaing26

    sylvaing26 New Member

    Messages:
    16
    Hardware:
    RPi3, +Arduino, +nodeMCU/ESP8266
    Hello,
    I want to modify hyperion for see effect when music is playing.
    Hyperion is hable to detect when kodi play music.
    I want, when kodi play music, to set a visual effect (the same of the boot for example).
    Where I can modify the source code for do that ?
    Thanks !
     
  2. Paulchen-Panther

    Paulchen-Panther Active Member Developer

    Messages:
    268
  3. sylvaing26

    sylvaing26 New Member

    Messages:
    16
    Hardware:
    RPi3, +Arduino, +nodeMCU/ESP8266
  4. sylvaing26

    sylvaing26 New Member

    Messages:
    16
    Hardware:
    RPi3, +Arduino, +nodeMCU/ESP8266
    Hi,
    finally, to preserve hyperion's updates, I've found this solution :
    create a autoexec.py file in /home/pi/.kodi/userdata with this content
    The hyperion service doesn't listen music playing.
    Code:
    import xbmc,xbmcgui
    import subprocess,os
    EFFET = 0           
    os.system('/usr/share/hyperion/bin/hyperion-remote --clear')
    
    while(1):
        if xbmc.Player().isPlaying():
            if xbmc.Player().isPlayingAudio():
                xbmc.log("#EFFET AUDIO ON#",level=xbmc.LOGNOTICE)
                if EFFET == 0 :
                   EFFET = 1
                   os.system('/usr/share/hyperion/bin/hyperion-remote --effect "Full color mood blobs"')
    
            else:
                if EFFET == 1 :
                   xbmc.log("#EFFET AUDIO OFF#",level=xbmc.LOGNOTICE)
                   EFFET = 0
                   os.system('/usr/share/hyperion/bin/hyperion-remote --clear')
    
        else:
            if EFFET == 1 :
                EFFET = 0
                os.system('/usr/share/hyperion/bin/hyperion-remote --clear')