Search code examples
livecode

A slider to control volume of mp3 music in livecode


I was wondering is there was a way to control the volume of something with a slider so that if the slider was one the value 0 there would be no sound, and if it was on 100, the sounds was as high as it could go

For the script, I tried something like "set the playLoudness of player 1 to value" Which obviously didn't work, and so yeah, I'm asking for your help..


Solution

  • Works fine here.

    on scrollbarDrag theValue
       set the playLoudness of player 1 to theValue
    end scrollbarDrag
    

    Of course you need set the startValue of the slider to 0, and the endValue to 100.