Change application volume from terminal

Is there a way to change individual application volumes from the terminal? I found a way to change the master volume which is amixer -D pulse sset Master 50% but I would like to be able to change volumes for individual applications like is possible in pavucontrol. My usage would be for scripting.


I found the solution hidden in a comment on unix.stackexchange. Use pactl list sink-inputs to find your application's sink input number. Then use pactl set-sink-input-volume [sink number] [volume percent] to set the volume of your application.