Skip to a section of audio

Is there a way to script a skip to a section of audio, i.e. begin playing 5 seconds from the start of audio clip, without putting a play head into the presentation?

Discussion (1)

You should be able to use the setTrackTime(time) method.

There is also a getTrackTime() method that you can use as well.

I'm attaching a sample title.

Note that the sample title uses the HTML name of the object. Instead I suggest you use the script token %HTMLNAME% in place of the actual HTML name. To do this the action would have to be attached to the audio object (for the token to work).

An alternative is to place an onShow Run JavaScript action on the audio object with the following code:

getDisplayWindow().myAudioObject = %HTMLNAME%;

Then in any JavaScript action you can reference the audio object as window.myAudioObject so you could call the above method like this:

getDisplayWindow().myAudioObject.setTrackTime(time);

For more information on these tokens see:

https://www.trivantis.com/help/Lectora_Online/4.3/en/HelpHTMLs/Content/5565.html

Discussions have been disabled for this post