Play a sound - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Play a sound (/showthread.php?tid=12887) |
- Nuka1195 - 2005-06-12 is there anyway to play a .wav file with python. one of the navigation sounds. what i want to do is, if music is playing pause the playback, play a sound (wav file) and then start the music playback again. the only way i can think of is to let the script control a playlist. stop the playlist, play an mp3, then restart the playlist, i guess from the begining. thanks - Nuka1195 - 2005-06-15 in case anybody wanted to know. you can use xbmc.player().play(file) and when that file is done playing, your playlist or the folder your playing continues. but i have a weird problem, when activating the visualisation window. i have to call a xbmc.player() command (playnext(), playprevious(), play(), pause()) or else my only visible control on the dialog loses focus and a setfocus will not work. play() messes up the playlist since i play an alert.mp3, i don't want to skip the currently playing song, so i use two pause()'s. should the setfocus work or is there a better way than how i'm doing it? thanks. Quote:def starttimer(self): - Nuka1195 - 2005-06-16 in case for future reference a simple sleep(.05) before the setfocus() did the trick. Quote:else: |