Background music

Hi.
I have the following issue with the background audio: background music continues normally when the slide is set to auto-advance. But when the slide has some custom element to go forward or backward, when I click on these to advance to the next slide, the music starts from the beginning (it is not continuous). Then, the audio is interrupted. This does not happen with all the slides.

I have the music configured like this: loop, autoplay and background music.

I also tried to add background music with javascript code, the music plays, but the player controls have no effect on it.

1 Like

Hi,

Currently, background music is still synchronized when jumping to each slide; and we will reconsider this behavior.

If you are using JavaScript, but are unsure how to handle audio play/pause events when triggered from the player controls, consider adding the following script to the project’s On Load event:


$(prez.ui).on('ap-pause', function(event, paused) {
    if (prez.myBGMusic) {
        if (paused)
            prez.myBGMusic.pause();
        else
            prez.myBGMusic.play();
    }
});

When creating the audio player, ensure that you assign it to prez.myBGMusic.

Regards,

Hi Hang, thank you for your reply.

However, the problem of skips in the background music occurs when I add audio as background music on a slide, so that it plays throughout the project (multiple slides). In this case the player controls (play, pause, volume level, etc) do work.

To avoid these jumps, what I tried was to add the background audio to the whole project, adding the file to the output folder of the project (not from the timeline), and adding the javascript code to play it. This works, but the player controls have no action on the audio when opening the project in any browser.

It is not clear to me what exactly I should do when you tell me: “When creating the audio player, ensure that you assign it to prez.myBGMusic”.

Thanks

Hi Juan,

Please share a small sample of your project that has JavaScript so we can help you with the pause/resume function. You can attach the file here or email us at support@atomisystems.com.

Best regards,

Hi,

I think I have a similar question/problem.

I would like to have different continuous background music for different parts of my project,e.g. track A for slides 1 to 10, track B for 13 to 27 and so on. Within these parts I need to be able to move freely from slide to slide as a result from events (i.e. not autoadvance), and forwards and backwards.

I do not need player controls or anything. Just the music. I assume this should be doable with JS…?

Thanks,

Rolf

Hi Rolf,

Starting from version 10.0, background music keeps playing smoothly across slides, even when you move between slides manually (i.e. not auto-advance). No need to use JavaScript anymore.

Regards

Thanks Toan,

That’s excellent news and it works perfectly.

What I would like to achieve is fade-out and -in effects. Say, Song A runs from 1 to 10. Slide 11 starts with Song B. The idea would be to have a short slide 10 that is just used for fading out Song A and then fade in song B at the start of slide 11. It seems that once I have made Song A background music, however, I cannot manually fade it out anymore. As a consequence, the transition is always very abrupt. I assume there must be a JS way of doing that - I do not know how, unfortunately.

Ideal would be a crossfade, i.e. on load of slide 11, fade out whatever song is playing at the moment, while fading in a new song. Can this be done?

Thanks in advance,

Rolf