To change the sound volume of a game you should use CDL the Cabinet Description Language to setup witch programs must to run for each event. We will use the after-insert-coin event to setup the game volume, and after-leave to back the game volume to the original.
AGEBasic property in the cabinet’s description.yaml
Age of Joy will load both programs when the cabinet loads. insertcoin.bas gets the actual global game volume and storage it in the originalVolume variable. Then it changes the game audio to 5 dB.
When the player leaves the game, Age of Joy will run the leave.bas program and restore the game volume to the original.