Audio stream stop in Android app because of doze

Is there a way to awoid the doze function android implemented in Andriuoid 6 and up? A foreground service maybe. Statusbar or lockscreen media control?