2015-05-08, 15:39
Try / instead of \ ... Also maybe its the underscore
(2015-05-08, 15:39)teeedubb Wrote: Try / instead of \ ... Also maybe its the underscore
03:20:57 T:2792 NOTICE: m_deviceName : {AE46835C-A823-4BCC-8624-F57DCEB1EB76}
03:20:57 T:2792 NOTICE: m_displayName : HDMI - M2762D (Urządzenie zgodne ze standardem High Definition Audio)
03:20:57 T:2792 NOTICE: m_displayNameExtra: DIRECTSOUND: M2762D (Urządzenie zgodne ze standardem High Definition Audio)
03:20:57 T:2792 NOTICE: m_deviceType : AE_DEVTYPE_HDMI
03:20:57 T:2792 NOTICE: m_channels : FL,FR
03:20:57 T:2792 NOTICE: m_sampleRates : 44100
03:20:57 T:2792 NOTICE: m_dataFormats : AE_FMT_FLOAT,AE_FMT_AC3,AE_FMT_DTS
09:58:10 T:140735137796864 DEBUG: OnKey: d (0xf044) pressed, action is RunScript(/Users/Shared/switch_audio.py)
09:58:10 T:140735137796864 ERROR: ExecuteAsync - Not executing non-existing script /Users/Shared/switch_audio.py
#audio toggle script for xbmc
import xbmc
import os
tempdir = xbmc.translatePath('special://temp/')
tempfile0 = os.path.join(tempdir, 'audiooutput0')
print("CURRENT AUDIO DEVICE:")
print(xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Settings.GetSettingValue", "params":{"setting":"audiooutput.audiodevice"},"id":1}'))
if not os.path.isfile(tempfile0):
#settings group 0
#edit below here
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice", "value":"WASAPI:default"}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.passthrough","value":false}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.channels","value":2}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{"title":"AUDIO OUTPUT", "message":"TV", "image":"/Users/Schimmi/Documents/KODI/tv_icon.png"}, "id":1}')
#edit above here
file = open(tempfile0, "a")
file.close()
else:
#settings group 1
#edit below here
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice", "value":"DIRECTSOUND:default"}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.passthrough","value":false}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.channels","value":2}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{"title":"AUDIO OUTPUT", "message":"Airplay", "image":"/Users/Schimmi/Documents/KODI/airplay_icon.png"}, "id":1}')
#edit above here
os.remove(tempfile0)