Explore the community Forums Lectora Inspire Tools Questions & Answers Controlling Background Audio in seamless play

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #389537 Score: 0
    Profile photo of Mihir Aich
    Mihir Aich
    Member
    beginner
    intermediate
    curious george
    wise owl
    contributor
    @maich4316

    Hi,
    I am using a background audio that runs across multiple pages. I also want to control it from the pages. I am using the Sound in Background properties in a Chapter that has four pages. This is the new feature in Lectora 17. I have used a global button (Chapter level) to control the BG Audio. However showing errors while publishing (seamless play). If I use the button in the pages then also it does not have any effect on the audio. And also the audio is looping. I am unable to view the audio in explorer and so unable to control the properties of the background audio, neither I can use action on it (like OnDonePlaying). Can anyone please help me if I am missing any settings?

    Thanks,
    Mihir

    #389982 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    89 pts
    @mnotermans5114

    Please post a sample.

    #390033 Score: 0
    Profile photo of Mihir Aich
    Mihir Aich
    Member
    beginner
    intermediate
    curious george
    wise owl
    contributor
    @maich4316

    Thanks for the reply.

    I have attached a LI 17 sample.

    The audio is playing seamlessly across multiple pages (seamless play publish), however I am unable to control it and it plays in loop.

    — Mihir

    Attachments:
    1. LI_17_BG_Audio.zip
    #390268 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    183 pts
    @Klaatu

    Change the action on the play/pause button and replace with this runJS script:

    if (getDisplayWindow().a001_occasions_for_tea_occasions_for_tea_BkAudioMedia.paused == true) {
    getDisplayWindow().a001_occasions_for_tea_occasions_for_tea_BkAudioMedia.play();
    } else {
    getDisplayWindow().a001_occasions_for_tea_occasions_for_tea_BkAudioMedia.pause();
    }

    Of course this is just ugly, it can be made more elegant. Let me know if this works for you.

    Darrel

    #390271 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    183 pts
    @Klaatu

    Whoops, just noticed that it doesn’t stay working across all pages. Hmmm, gonna go shovel some of this Nor’Easter snow out of my driveway then I’ll take another look see.

    #390371 Score: 0
    Profile photo of Mihir Aich
    Mihir Aich
    Member
    beginner
    intermediate
    curious george
    wise owl
    contributor
    @maich4316

    Thanks for your effort Darrel. I’am still unable to solve this.

    #390415 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    228 pts
    @timk

    Isn’t Background sound meant for music to be playing all the time and to be looping? I mean, wouldn’t it be easier for voiceover to use a separate normal audio object for each page so you can use all the usual features?

    It seems to be a bug that it’s possible to target the background audio in actions. This is also new in Lectora 17. Although of course it would be nice to make the background audio controllable with the normal actions.

    Here’s your sample using Darrels code to play / pause. It also prevents the audio from looping. The background audio gets a different id on each page that contains the page name. It would be easier to control if it always had the same id.

     

    #390733 Score: 0
    Profile photo of Mihir Aich
    Mihir Aich
    Member
    beginner
    intermediate
    curious george
    wise owl
    contributor
    @maich4316

    Thanks a lot. However, it is still not running properly, throwing JavaScript errors. I tried to suppress the errors, however after a few clicks again the error pops up.

    #390790 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    183 pts
    @Klaatu

    It plays fine. the problem comes in when you try to hit the pause/play button before the page loads (transition completes). You might want to disable the play/pause button until after the page loads.

    #390792 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    183 pts
    @Klaatu

    Thanks, Tim. 😉

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.