v18 playSFX dont work
#1
Hello,

I try to use "playSFX" to play a soundfile. But no matter what I do, it doesn't work Confused

Here is the Code:
python:

import xbmcgui
import xbmc
xbmc.playSFX('special://home/addons/script.hello.world/resources/wavs/set_ok.wav',True)
xbmc.playSFX('special://xbmc/addons/script.hello.world/resources/wavs/set_ok.wav',True)
xbmc.playSFX('/home/pi/.kodi/addons/script.hello.world/resources/wavs/set_ok.wav',True)
xbmcgui.Dialog().notification("Check", "Done", xbmcgui.NOTIFICATION_INFO, 2000)

The wave-file is an place:

Image

There is no error when executing the addon- But also no sound ;(

Whats wrong?
Reply
#2
1 there's no need to hardcode the path
python:
import xbmc
import xbmcaddon
import os

path = xbmcaddon.Addon().getAddonInfo('path')
sndfile = os.path.join(path, 'resources', 'wavs', 'set_ok.wav')

xbmc.playSFX(sndfile, True)

2 this settings needs to be enabled:
settings > system > audio > play gui sounds
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
(2020-03-13, 18:48)ronie Wrote: 1 there's no need to hardcode the path

2 this settings needs to be enabled:
settings > system > audio > play gui sounds

1) I know. But when it doesnt work, you try everything Wink
2) cant find somthing like that in der german version:

Image
Image
Reply
#4
OK, I got it. It was THIS.
Image

Now it works. THANK YOU!
Reply

Logout Mark Read Team Forum Stats Members Help
playSFX dont work0