How do I use <AudioTrack>.remaining()?

I’m trying to use <AudioTrack>.remaining() but I am not sure how it works.

Basically, I would like to set a story variable, $audiotrackremaining to <AudioTrack>.remaining().

Call the audio track thisaudio, played through <<audio "thisaudio" play>>.

I can probably figure things out from there.

Twine Version: 1.4.2
Story Format: Sugarcube 2.x

You retrieve a reference to the track via SimpleAudio.tracks.get(), then you call its .remaining() method.

For example:

<<set $audiotrackremaining to SimpleAudio.tracks.get("thisaudio").remaining()>>
1 Like

Thanks, I will try it out.