How do I attach audio volume to built in sliders?

0 favourites
  • 7 posts
From the Asset Store
slide the tiles to fill the board.60 awesome levels.
  • MANY THANKS to anyone who could PLEASE help me with this problem

    I have tried everything to get what i thought to be a potentially simple mechanic to work

    but unfortunately have not had much success :(

    At first i tried to set Global Variables for MUSIC and FX

    in which i could tie to each Audio's set.volume parameter to be controlled by slider

    when i couldnt get that to work, i decided to just try a simple attach slider to the volume of a specific audio file playing directly, and STILL no success

    I can seem to figure this out whatever i do

    Any help will be GREATLY appreciated

    My utlimate goal is to have 2 sliders using C2s built-in slider behavior tied directly to the audio volume variables set, but if that isnt possible, even events calling out for each specific sounds would be fine, as im not using many in my game.

    i initially searched the forums and found several older posts regarding this situation, but every example capx and links are broken, so im unable to get any help with existing past posts

    thank you in advance for any and all help.

    capx:

    http://caito.coffeecup.com/temp/musicfxslider_v3.capx

  • See this demo:

    dropbox.com/s/y78off25hd7twh0/VolumeSlider.c3p

    Edit: Are you using Construct 2? You should have posted in C2 forum.. You can still open this demo in free version of C3 and copy events to your project.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Moved to Construct 2 forums.

    We just had this example released in Beta R212 for Construct 3 that shows how to do some interface for an audio player, including handling volume :

    editor.construct.net

    Same theory applies in Construct 2

  • dop2000 & Kyatric - Your replies are incredibly appreciated :) THANK YOU

    dop2000 This is EXACTLY what i was looking for!!! Your example makes so much sense. I guess setting it as a FUNCTION to call out to instead of directly helped make it work? either way, I am SO GRATEFUL to you for taking the time to help me out. Your definitely one of the good ones :)

    Kyatric, many thanks for your time & input as well, could you kindly point me to which example? I went over the examples the other day, and found the audio fx example, but it unfortuantely did not have volume or interface. Thank you again, your guys helpful attention is appreciated so much.

    regarding post placement, i will for sure be mindful of that for the future, my plan was to migrate to c3 from c2 mid project, and since this was something i thought perhaps should potentially work in both, i thought it would be ok, but will be careful next time :)

    Thank you so much again in advance for all the help you've thrown my way

    The construct community ROCKS! :D

  • It is in R212, latest beta available, in the "Intermediate examples".

    The direct link to the example is this : https://editor.construct.net/#open=audio-player

  • Thank you Kyatric for your time.

    I did see the example of audio effects, but not one that might be more pointed towards what i was looking for in attaching a slider to the volume.

    but thank you so much for your timely response.

    I always impressed with the construct communities great attitude

    anyhow, dop2000 generously shared some code with me above that is closer to what i was looking for

    many thanks again!!! :)

  • The new "Audio player" example, only available in R212 specifically shows how to make a volume slider (with sprites) and provide the formula to apply. (last event N°22 in the event sheet, with a specific comment explaining the theory right above it)

    You simply have to replace with the slider bar object and use its dedicated conditions (like "On changed") and expressions like "Maximum" and "Value".

    Volume = (45 - ((45/SliderBar.Maximum) * SliderBar.Value)) * -1

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)