Closed Yashraj254 closed 1 year ago
the settings string definitely has to be more descriptive, any suggestions?
what about "Manage Audio Interruptions" or "Allow Concurrent Playback"
lets make it Allow concurrent playback with other apps
yeah sure.. so should i keep it enabled or disabled by default..
keep the current version as default, so disabled
alright.. it's done
ok, @Naveen3Singh can you check if this is the proper way to avoid ducking?
Three things:
This won't work on Android 12 and above because the audio focus is now managed by the system. The system forces audio playback from an app to fade out. We could maybe workaround this by setting AudioAttributes.CONTENT_TYPE_SPEECH
but we will probably get flagged for some policy violation on Google Play. If we want to enable this feature for Android 11 and below, then a check should be added for that.
If we want to avoid ducking (lowering the volume) for notifications etc. the config.allowConcurrentPlayback
check should also be added in the AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK
case.
The mentioned use case in #366 doesn't seem possible unless we either lower our player volume (duck) when another player starts or provide internal volume control.
Other than that, this works as expected on Android 11 and below versions.
right, the check seems to have no effect on my Android 13. So thanks for the effort, but I dont want to add new options for low OS versions.
well it works in latest android version too.. but only if we play the music in Simple Music Player first and then in some other app like spotify or a video player..
if someone tries to play the music in some other app like spotify at first and then tries to play in Simple Music Player.. then spotify music will be paused.. so one can just go back to that app and resume the music or video and both can be played concurrently... it's a small drawback of this feature
well it works in latest android version too.. but only if we play the music in Simple Music Player first and then in some other app like spotify or a video player.. if someone tries to play the music in some other app like spotify at first and then tries to play in Simple Music Player.. then spotify music will be paused.. so one can just go back to that app and resume the music or video and both can be played concurrently... it's a small drawback of this feature
that's by design and only true for Android 11 and below.
Android 12 and above versions will just silence Simple Music Player if we don't respect AUDIOFOCUS_LOSS
: https://developer.android.com/media/optimize/audio-focus#audio-focus-12
well that's odd.. i am using android 13 and it's working as i described
could be some custom feature by the vendor. For example, Samsung has a Dual App Sound feature on some of their devices.
well i am using one plus nord.. which one you are using here is a sample ... recorded on android 13
Fix #366
Added Concurrent Playback feature which is disabled by default to handle interruptions from other apps and if enabled it will allow concurrent playback with other apps.