Audio volume increase when clicking button

Hello, I’m currently playing some audio on a loop and trying to find some code that can make the volume output increase with a keyboard press as an test.

I want the audio volume to play at 100% for about 5 seconds or so and then just fade out until the keyboard press has been activated again.

Thanks Samuel.

This may give you some rough ideas:https://projects.raspberrypi.org/en/projects/sound-machine