Specific music-stopping issues occur with Android devices. These can be resolved by a simple change in your phone settings.
Samsung Devices (https://dontkillmyapp.com/samsung)
Start Device care from phone settings
1. Tap Battery
2. Tap the 3-dot menu > Settings
3. Disable all toggles (except Notifications)
4. Tap Sleeping apps
5. Wake up all the apps using the trashcan icon
Other Android Devices (https://dontkillmyapp.com/)
Android 8+
Check if Phone settings > Apps & Notifications > Your app > Background restrictions or Background limits are not enabled for the app.
If all fails you can turn Doze mode off completely.