On AOSP Android 6.0 Marshmallow, this feature is integrated into the OS.
From an article on Pocket-lint,
Android 6.0 Marshmallow: Volume controls
One of the places where Lollipop went a little haywire was with the volume and controlling those new notifications. These new fangled volume controls sent ripples across Android devices on Lollipop with manufacturer skins that followed, and have been tweaked by all and sundry ever since.
On Android 6.0 Marshmallow, they have changed. Hooray!
Hitting volume down or up will open the volume controller and a drop-down arrow will let you change the ringer volume, alarm volume and media volume independently. That means you can ensure that game you're about to start up in bed doesn't blare out music as soon as it opens.
Image courtesy of TrustedReviews