SimpleMobileTools / Simple-Music-Player

A clean music player with a customizable widget, stylish interface and no ads.
https://www.simplemobiletools.com
GNU General Public License v3.0
1.28k stars 406 forks source link

FIX #366 added audio focus feature #547

Closed Yashraj254 closed 1 year ago

Yashraj254 commented 1 year ago

Fix #366

Screenshot 2023-07-10 033928

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.

tibbi commented 1 year ago

the settings string definitely has to be more descriptive, any suggestions?

Yashraj254 commented 1 year ago

what about "Manage Audio Interruptions" or "Allow Concurrent Playback"

tibbi commented 1 year ago

lets make it Allow concurrent playback with other apps

Yashraj254 commented 1 year ago

yeah sure.. so should i keep it enabled or disabled by default..

tibbi commented 1 year ago

keep the current version as default, so disabled

Yashraj254 commented 1 year ago

alright.. it's done

tibbi commented 1 year ago

ok, @Naveen3Singh can you check if this is the proper way to avoid ducking?

naveensingh commented 1 year ago

Three things:

Other than that, this works as expected on Android 11 and below versions.

tibbi commented 1 year ago

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.

Yashraj254 commented 1 year ago

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

naveensingh commented 1 year ago

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

Yashraj254 commented 1 year ago

well that's odd.. i am using android 13 and it's working as i described

naveensingh commented 1 year ago

could be some custom feature by the vendor. For example, Samsung has a Dual App Sound feature on some of their devices.

Yashraj254 commented 1 year ago

well i am using one plus nord.. which one you are using here is a sample ... recorded on android 13

https://github.com/SimpleMobileTools/Simple-Music-Player/assets/52420957/e430e81b-7d82-4773-ba72-7cac776c0821