The syntax I've chosen for this feature involves angle brackets at the start of the filename string, which contain optional start and stop times, separated with a dash.
The audio filename "<-15.5>karaoke.ogg" will play the first 15.5 seconds of karaoke.ogg. The filename "<22->karakoke.ogg" will play from 22 seconds to the end of the file. The missing portion could be played with "<15.5-22>karaoke.ogg", which plays for 6.5 seconds.
The reason for this syntax is that Ren'Py already uses strings to represent sound files, and so it's easier to pass this around a "filename", rather than dealing with special objects, syntax, etc.
Notably, this will allow one of the most requested features. Using code like:
Code: Select all
play music "neverending.ogg"
queue music "<12.2->neverending.ogg"