Sounds in JavaScript

Problem:

Summary

I was wondering if there was any way to cause a sound to made from JavaScript.
If this is possible, I was wondering if there was a way to activate sounds either custom sounds or the ones built into ActivePresenter.
Thank you

ActivePresenter version:

OS:

Notes:

Hi,

You can do as follows:

  1. Insert an audio object into the slide, set it autoplay and initial hidden.
  2. Add an additional timeline, and an appear effect of the audio object to that timeline.
  3. Use prez.startTimeline('timeline name'); to start the timeline. It’ll play the audio.

You can also use only JavaScript as mentioned in this thread:

Regards

Hi,
Thank you for your help.
Is there any way that you could send me an example where this is used to have a sound play at a controlled time? Because, I may have made a mistake, but the timeline only starts when the user clicks something on the slide.

Thank you

Hi John,

You should not use JavaScript or other actions to play a sound at a specific time.
Just insert the sound at that time in the main timeline.

Regards

Hey @ToanLS
is there a way to stop the timeline and restart it from the beginning?
I have several obejcts on a timeline but when “pause timline” is triggered and “start timeline” is triggered again (to replay the timeline) the objects that were initally hidden are now shown (because they are shown when the timeline ends) and the timeline starts from the beginning so objects are overlapping.
Is there a function like “Stoptimeline” or “restarttimeline”?
I think “pause timeline” just jumps to the end of the timeline.

Kind regards
Sarah

Hi @sariwest,

“Start timeline” action will jumps to the end of the timeline if it isn’t completed yet before restarting, so you see the initially hidden objects appear.
You can add disappear effects for your objects at the end of your timeline to overcome this issue.
We’ll improve these timeline actions in version 9.

Regards

1 Like