Search code examples
androidapp-inventor

Fade Volume on Button Click


I'm writing an app to Play music on APP INVENTOR 2 by MIT. I have a Button to Control volume. Which when i Click must return to set value in Player's Volume. I can adjust the volume. but i can't get it to reduce gradually with time.

In example: An audio track is playing in volume 100% Then the Volume down button is pressed Volume of the audio track must be set to 25% but Gradually.. like within 5 seconds. (not suddenly)

Creating a smooth Volume Fade. Can anyone help?

Many thanks!


Solution

  • Create a While loop to control the volume fade In and fade Out:

    Screenshot