KieronQuinn / AmbientMusicMod

Port of Now Playing from Pixels to other Android devices
GNU General Public License v3.0
1.86k stars 41 forks source link

Provide a way to enable recognise while device is is playing #198

Closed soodsid closed 7 months ago

soodsid commented 1 year ago

So we can recognise the song while we are playing the song from the same phone.

meilluer commented 11 months ago

Open app in split screen

KieronQuinn commented 7 months ago

I've been evaluating this and it's not really possible.

As far as I can tell there is no other option. The assistant mic is muted when sound is playing (which is why the app tells you another app is using device audio), so it's not as simple as just disabling the check.

meilluer commented 7 months ago

I've been evaluating this and it's not really possible.

  • Using the REMOTE_SUBMIX audio source is able to capture device internal audio, but it also stops it playing through the speakers. Not an option.
  • Using the projection APIs would require either a permission dialog every time it wants to record, or root. Also not an option, since AMM does not require root on Android 12+.

As far as I can tell there is no other option. The assistant mic is muted when sound is playing (which is why the app tells you another app is using device audio), so it's not as simple as just disabling the check.

Something like this is already possible in shazam(maybe you can tray replicate it?), maybe it uses external mic from headphones as they are closer to audio source. If none of it works you be root implementation could be implemented as a root-only feature

KieronQuinn commented 7 months ago

I've been evaluating this and it's not really possible.

  • Using the REMOTE_SUBMIX audio source is able to capture device internal audio, but it also stops it playing through the speakers. Not an option.
  • Using the projection APIs would require either a permission dialog every time it wants to record, or root. Also not an option, since AMM does not require root on Android 12+.

As far as I can tell there is no other option. The assistant mic is muted when sound is playing (which is why the app tells you another app is using device audio), so it's not as simple as just disabling the check.

Something like this is already possible in shazam(maybe you can tray replicate it?), maybe it uses external mic from headphones as they are closer to audio source. If none of it works you be root implementation could be implemented as a root-only feature

Shazam will use the projection option, it's not an option for automated recognition. I also don't want to add it as a root-only feature because the rest of the app has moved away from that.

soodsid commented 7 months ago

I didn't knew it was possible to add a comment in the closed issue so I just created another issue about it and I also posted a solution, it's not a solution basically but it is a workaround. so if you want to you can try that

https://github.com/KieronQuinn/AmbientMusicMod/issues/224

megapro17 commented 1 month ago

why it can recognize songs on pixel when device is playing anyway?