0

Fade audio in video by GPIO

Hi!

I would like to add a little smoothness to my project, please. The project works but it changes volume a bit too sharp/fast. Is there any way to add a fade feel to the changes in a videoloops audio levels triggered by GPIO?

Project description: My project changes the audio volume in a videoloop when a motion detector triggers on and off. I use "connector volume" and "set audio" function triggered via two ports in GPIO on a xd1033. The sound goes from 20% to 80% when visitor enters triggered area and then back to 20 when visitor leaves area.

Is it possible to make the audio changes smoother? I use brightauthor and have no scriptskills.

thank you

/Nils 

 

 

8 comments

  • 0
    Avatar
    Bright Scripters

    Here is how to fade the audio using BrightAuthor.

    Ingredients

    User Variable named "AudioLevel", initialized to the default audio level 80. Will be used to control audio level

    Timeout Event set to 0.05 seconds, or similar value. That would be the time interval between volume change during the fade process.

    Conditional Targets in the Timeout Event.

    Conditions:

    If AudioLevel greater than 20, decrement AudioLevel, and set the zone level to the value of AudioLevel, using $$AudioLevel$$

    If AudioLevel less or equal to 20 stop fading (transition to a different state)

     

     

     

     

     

  • 0
    Avatar
    Nils Marklund

    Thank you!!

    Will give it a try.

    /nils

  • 0
    Avatar
    Nils Marklund

    Hats off! Thank you for great instructions! It' took me a while as I had to figure out the whole user variable thing.

     

    As it happened I made three different  mediastates/eventhandlers. Don´t know if it is necessary or if there are other better ways to do it, but hey, it works!

    My movement sensor acts as two buttons, 1 and 2, triggered by a relay set as normal closed. Button 1 acts upon push and button 2 upon release.

    Posting a pic of project as it may help someone else. Or if someone has a better way they can correct me.

    Thanks!

    /Nils

     

  • 0
    Avatar
    Bright Scripters

     

    I found that it helps managing future changes, by separating visible media from control related elements.

    You could add a second zone, and place the event handlers in.

    A zone typically contain visible media, but is not required to.

     

  • 0
    Avatar
    Chris Russell

    Hi - I have tried using this method to fade the audio on a playing audio track when a button input is received, then move on to another track. When this track has completed, it should loop back to the initial state, and then go to play Track 1 again, and have a query. When Track 1 plays the first time through, the fade down works properly when the button is pressed. I then set the audio zone level back to 100 so that I can hear Track 2. However, when Track 1 plays the second time round and the button is pressed again, the audio just cuts out and doesn't fade down.

    I am unsure of why this is - any suggestions? I can post some images of my playlist if needed. I've used Brightsigns for a few years but haven't had to use variables before.

    Thanks.

  • 0
    Avatar
    Bright Scripters

    A download link to your presentation, would be helpful.

  • 0
    Avatar
    Chris Russell

    Hi - I have resolved the issue, with help from the Brightsign support desk. I had not reset the variable to 100 when exiting one of the states, so the audio was not fading down. Thanks for your reply, and for the original post - it was exactly what I needed. 

  • 0
    Avatar
    cmckelvey

    I am attempting something similar, but I do not see Audio Level as an option in the drop down menu, it is blank. How can I find these commands?

Please sign in to leave a comment.