VolumeLockr allows you to control your Android device volume levels and set locks for each one of them.
You can either download it from F-Droid or build it manually.
git clone git@github.com:jonathanklee/VolumeLockr.git
cd VolumeLockr
./gradlew assembleDebug
adb install ./app/build/outputs/apk/debug/app-debug.apk