Kodi Community Forum

Full Version: Play (and stop) sounds from Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings,

In the interface I am developing, I need to play audio sounds for a few things. First, a button push.
I may be able to do this in the XML with:
<onclick>XBMC.PlayMedia("the file.mp3")</onclick>

But can it be done in python as well? [Other than XBMC.executebuiltin()]

Secondly, is it possible to play a sounds as such, and then stop it when something else occurs?

For an example, let's say you've built an alarm clock application. You want to sound an alarm at 8:00 and continue to play a sound (which could be a 30 minute audio file, or whatever) until the user presses "stop", "snooze", "I'm awake" whatever.

Thanks!