KieronQuinn / AmbientMusicMod

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

Just a suggestion (recognize the song while they are playing from the phone) #224

Closed soodsid closed 5 months ago

soodsid commented 5 months ago

I know this is an online issue in which you are not able to recognize a song which are playing from your own phone

I have created a workaround for this. You would need to install an app called automate and as soon as any media is playing or any song is playing, you can use the ambient mode API to trigger an online search for the song(online search can still work while music is playing). In this way you will be able to search for a song as soon as it will start playing from your phone and it will show up in your now playing history.

https://llamalab.com/automate/community/flows/47360

KieronQuinn commented 5 months ago

You can already start an online recognition from in the app, you don't need to use Automate for that. Recognition will continue with the app minimised.

soodsid commented 5 months ago

This just makes it automatic. For the people who dont want go in the app for every song you play and recognise it. This will recognise each song/media automatically and put it in now playing history.

KieronQuinn commented 5 months ago

Understood. Any sort of automation of the online recognition will never be added to the app because it introduces sending audio to Google without user interaction.

megapro17 commented 5 days ago

This shit isn't working at all. Firstly it will only trigger if you play a music file making this automation mostly useless because it's a very rare situation when you're playing a music file from your phone without a name.

This block only works with media players using the official Android API for exposing media controls, usually show on the lock screen.

Secondly I tried modifying it and the app doesn't give any sign if intent is even working or if the token is invalid, no trace in logcat even with advanced logging

cls | adb logcat -c | adb logcat | select-string "AmbientMusic"

adb shell am broadcast -a com.kieronquinn.app.ambientmusicmod.action.RUN_RECOGNITION -e token sEftxJlHFGncvoQCUwg9hA

KieronQuinn commented 5 days ago

This shit isn't working at all. Firstly it will only trigger if you play a music file making this automation mostly useless because it's a very rare situation when you're playing a music file from your phone without a name.

This block only works with media players using the official Android API for exposing media controls, usually show on the lock screen.

Secondly I tried modifying it and the app doesn't give any sign if intent is even working or if the token is invalid, no trace in logcat even with advanced logging

cls | adb logcat -c | adb logcat | select-string "AmbientMusic"

adb shell am broadcast -a com.kieronquinn.app.ambientmusicmod.action.RUN_RECOGNITION -e token sEftxJlHFGncvoQCUwg9hA

Now Playing is not intended to recognise music playing on the device. It is for recognising music playing from elsewhere.

There being no indication of the token being valid is intentional as a security feature. It is your responsibility to make sure it is when running the intent.