While not 100% the desired solution (I don't know if there's any way to force Android playing sounds to a specific output device), as a work-around it is possible to silence undesired sources.
As you mioght have noticed, Android has multiple "channels" for different kind of sounds, where you can adjust volume independently -- such as alarms, notifications, ringer tone, etc. So this can be used in the way of turning down unwanted types to zero, while keeping the once you want turned up. Of course, doing so manually can be a hazzle (and one might forget to reverse changes afterwards, especially when in a hurry). So let's look for an...
There are several "automation apps" on the playstore which might handle this, such as Llama - Location Profiles or Tasker. Using the latter, I can for sure say it can handle this in the following way:
Condition: App running (select apps you want to match)
Task: (Volume adjust: chose which ones you want to change to zero here, but keep media volume on)
What will happen now? Once an app from your selection comes to foreground, the rule will match and the volumes will be adjusted accordingly. As soon as none of the apps you chose is running in foreground any longer, volume settings are reverted to what they have been before.