Is there a recommended UX reason for including a Mute button in a mobile app for in-app sounds? It seems redundant since the mobile device itself (e.g. iPhone, iPad, Android phone/tablet) has a physical mute and/or volume switches. Yet I see many casual mobile games have a Mute button in their options menu. As a programmer, it is easy for me to include it, of course, but I like to keep my UI design minimal (avoiding giving the user extraneous options). So I am just wondering if there is a good reason why this is done in some cases that I cannot think of.
TL;DR: An app forcing me to use the global mute would be uninstalled in the blink of an eye. So they better have a mute function if they want to use audio at all.
EDIT: The previous was a bit too short for an answer, here's an explanation:
Audio is in essence quite intrusive, that is, you can hardly block it out. That's different from vision - you can chose to close your eyes, you can look elsewhere, you will not even notice your smarthphone screen if you don't look at it at least peripherically, and you won't see the UI of apps in the background.
So any audio signal from my smartphone will always cause a more or less strong interruption of my current train of thought. This means that I am quite selective of which app gets to play audio. This is basically the telephone app (incoming calls) and the alarm app (certain very important alarms) because I actually want them to interrupt what I am doing. Even those may be reduced to vibration only at times where I don't want sound.
Now. If some app which is mildly useful to me, but not essential (like the aforementioned) would insist on playing audio, I would have a problem. I would be forced to either mute everything (not good if my alarm/incoming calls are missed) or live with it. Since the app presumably is not essential, I likely won't live with it, but look for a replacement.
Hope that clears it up.
The physical mute and volume buttons affect all other apps too. It's better to have a mute button in your app because as a user I may only want to mute the notifications from your app and not others. For example, there's a chance I want to mute Facebook notifications but not those from Twitter. So for that I'd need a mute button in Facebook because the device mute will just mute all apps.
Just a small extra consideration but I'll make it an answer anyway. I tend to listen to the radio via an app whilst playing casual games so need to be able to choose which app's volume to control. If I had to use the volume control for all apps I wouldn't be able to complete half of my objective (as I want to do both). This goes beyond the other answers that refer to notifications as most modern devices make the distinction between notification sounds and app sounds but don't make the fine-grained one between two apps' sounds.
Mobile OSes usually have broad scoped sound controls instead of app specific ones. Android (AOSP) sound volume has three separated controls: one for general effects and notifications, another one for multimedia apps and the last one for alarms. But those are system-wide, so adding sound controls into the app you can control the app specific sound volume without altering the system settings.
Games are a special case in where adding sound controls is recommended. By adding sound controls in games you allow players to switch on/off both background music and sound effects in separate controls. Personally I find most mobile games' background music annoying, but I like the sound effects, so I like when I can set this up at my will.
Another consideration is that physical parts can break, especially in cheaper devices. So it's good to have a software alternative on the OS or app level.