How to get the Song ID, Album ID and Artist ID from the currently playing song from the google play music

google play music app
google play music for chrome
music id google
google play music album art missing
change album art google play music android
google play music login
google play music sign in
google play music free

I am working on my app in which i want to get the details of the songs playing on any media application. I am not getting the data of the Google Play Music apps currently playing songs details like song id, artist id, album id.

I have tried below code:

IntentFilter intentFilter=new IntentFilter();

        intentFilter.addAction("com.android.music.metachanged");
        intentFilter.addAction("com.android.music.playstatechanged");
        intentFilter.addAction("com.android.music.playbackcomplete");
        intentFilter.addAction("com.android.music.queuechanged");
        intentFilter.addAction("com.samsung.sec.android.MusicPlayer.metachanged");
        intentFilter.addAction("com.spotify.music.playbackstatechanged");
        intentFilter.addAction("com.spotify.music.metadatachanged");
        intentFilter.addAction("com.apple.android.music.metachanged");
        intentFilter.addAction("com.apple.android.music.playstatechanged");
        intentFilter.addAction("com.rdio.android.metachanged");
        intentFilter.addAction("com.rdio.android.playstatechanged");

        //register the intentfilters into the reciever
        registerReceiver(mReceiver,intentFilter);

Here is my Reciever:

    BroadcastReceiver mReceiver=new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, final Intent intent) {
            String action = intent.getAction();
            //Bundle bundle=intent.getExtras();

            String cmd = intent.getStringExtra("command");
            Log.v("tag ", action + " / " + cmd);

            //not getting the song id in the google play music and album_id and artist id in both
            final String song_id=String.valueOf(intent.getLongExtra("id", 0));
            final String album_id= String.valueOf(intent.getLongExtra("album_id",0));
            final String artist_id= String.valueOf(intent.getLongExtra(MediaStore.Audio.Artists._ID,0));
            final String title=intent.getStringExtra("track");
            final String playlist_id= String.valueOf(intent.getLongExtra(MediaStore.Audio.Playlists._ID,0));
            final String playlist_name=intent.getStringExtra(MediaStore.Audio.Playlists.NAME);
            final String artist=intent.getStringExtra(MediaStore.Audio.AudioColumns.ARTIST);
            final String album=intent.getStringExtra(MediaStore.Audio.AudioColumns.ALBUM);
        }
    };

Getting the songs details in the default player but not in google play music.


As the other answers are only kinda correct but not fully here's the actual answer to that question: PlayMusic has it's own content provider you can query.

Here's a working example (trackId is the SongId extra from the intent):

private void loadPlayMusicSongDetails(Context context, String trackId){
    String artistName = null;
    String albumName = null;
    String trackName = null;
    long year = 0;

    String[] proj = { MediaStore.Audio.AudioColumns.TITLE,
            MediaStore.Audio.AudioColumns.ARTIST,
            MediaStore.Audio.AudioColumns.ALBUM,
            MediaStore.Audio.AudioColumns.YEAR,
            MediaStore.Audio.AudioColumns.ALBUM_ID,
            PLAY_MUSIC_COLUMN_ARTWORK_LOCATION,
            //"artworkUrl",
            //"VThumbnailUrl",
            MediaStore.Audio.AudioColumns._ID };

    Uri gMusicUri = Uri.parse("content://com.google.android.music.MusicContent/audio");

    try {
        Uri uri = ContentUris.withAppendedId(gMusicUri, Long.parseLong(trackId));
        Cursor cursor = context.getContentResolver().query(uri,
                proj, null, null, null);

        if(cursor.moveToFirst()){
            int titleColumn = cursor.getColumnIndex(MediaStore.Audio.AudioColumns.TITLE);
            int artistColumn = cursor.getColumnIndex(MediaStore.Audio.AudioColumns.ARTIST);
            int albumColumn = cursor.getColumnIndex(MediaStore.Audio.AudioColumns.ALBUM);
            int yearColumn = cursor.getColumnIndex(MediaStore.Audio.AudioColumns.YEAR);
            int albumArtColumn = cursor.getColumnIndex(PLAY_MUSIC_COLUMN_ARTWORK_LOCATION);

            trackName = cursor.getString(titleColumn);
            artistName = cursor.getString(artistColumn);
            albumName = cursor.getString(albumColumn);
            year = cursor.getLong(yearColumn);
            String albumArtLocation = cursor.getString(albumArtColumn);

            if(albumArtLocation != null && albumArtLocation.length() > 0){
                if(albumArtLocation.startsWith("mediastore:")){
                    long albumId = Long.parseLong(albumArtLocation.substring(albumArtLocation.indexOf(":")+1));
                    Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart");
                    setAlbumArtUri(ContentUris.withAppendedId(sArtworkUri, albumId));
                }
                else {
                    //TODO: perform http calls if you wanna query for online images
                }
            }
        }

MusicID, I am not getting the data of the Google Play Music apps currently playing songs details like song id, artist id, album id. I have tried below code: Alexa has a feature to help users find and identify new music called Song ID. Listening to music using Alexa usually starts with a specific request. You say something like, "Alexa, play Revolution


For getting song id,artist id and album id you should use this method. From that you can get it.

       ContentResolver contentResolver = getActivity().getContentResolver();

        Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
        String selection = MediaStore.Audio.Media.IS_MUSIC + "!= 0";
        String sortOrder = MediaStore.Audio.Media.TITLE + " ASC";
        Cursor cursor = contentResolver.query(uri, null, selection, null, sortOrder);

        if (cursor != null && cursor.getCount() > 0) {
            audioList = new ArrayList<>();
            while (cursor.moveToNext()) {
                String data  = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.DATA));
                String title = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.TITLE));
                String album = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM));
                String artist = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.ARTIST));
                String album_id = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));
                Long albumid = Long.parseLong(album_id);
                Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart");
                Uri finaluri = ContentUris.withAppendedId(sArtworkUri, albumid);
                String path = FileUtils.getPath(getContext(), finaluri);
                //Bitmap artwork = BitmapFactory.decodeStream(in);

                // Save to audioList
                audioList.add(new Audio(data, title, album, artist,path));
            }
        }
        cursor.close();

Music on Google Play, See album art for your favorite artists the way they intended it, in all its glory. KEY FEATURES • Quickly identify music playing around you • Add a note to Doesn't work it gets stuck in the introduction page where you are supposed to click on a If app can't ID a song, I'd prefer it said that instead of "get closer to the music. Go to the Google Play Music web player. Select a song. Press and hold the Ctrl (Windows) or Command (Mac) key. Select the songs you want to add. Near the top of the screen, select the pencil icon . Update the text fields or select Change on the album art area to upload an image. Select Save.


I read a blog before,Give you a thought, I have not tried, but the feeling should be able to achieve.

1.when the next music is played, the app will be broadcast and the broadcast will contain the next song's information;

2.for example:Android system's music player will send with "com.android.music.metachanged" broadcast;

3.registerReceiver

IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("com.android.music.metachanged");
registerReceiver(Your Receiver, intentFilter);

4.Analysis of intent,You can get this information from the intent

intent.getStringExtra("album");
intent.getStringExtra("artist");
intent.getStringExtra("track");
intent.getStringExtra("notify_artistname");
intent.getStringExtra("notify_audioname");

5.I do not know if Google Play Music will send a broadcast,also,I'm not sure about Google Play Music's IntentFilter.

6.Wish you success!

Edit music metadata & album art, Hot New Music. Get the latest albums & singles · See more · Polaroid · Keith Urban. $1.99. THE SCOTTS · THE SCOTTS. $1.29. Fire In Bone · The Killers. $1.29. I think you need to have your own model classes from wherein you can set and get your song title. For this and other information, see Stack Overflow question: How to set the PlayList Index for Mediaplayer(ExpressionMediaPlayer:Mediaplayer). If you are keen to know how it is being implemented, you can get the source and see how they have


You need to read Id3Tag to get this information, here is some documentation for MediaMetadataRetriever. You can use it to work with Id3Tag in Android.

Usage example:

MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(filePath);
String albumName = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM);

How do I play my own music on Android Auto , You can update the album art and metadata (information like song name, can edit your music's metadata and album art using the Google Play Music web player. Go to the Google Play Music web player. My album is appearing more than once An identification of Google as the music store distributor; Google's digital  If you don't want to get song notifications at the top of your screen, you can turn them off. Open your phone's Settings app. Tap Sound Now Playing. Tap Notifications. Turn off Show notifications. You'll still get song info on your lock screen.


Billboard, I can see the music by Artist, Song, Album, Genre, etc., and I can easily select any music I want. However, using Google Play Music via Android  This tool instructs you to “sing or hum” a particular song, but you don’t have to do that. Play the actual song for your computer’s microphone to hear and it will identify the song. As with the above tools, Midomo can pick up audio coming from your computer’s speakers, so you can use it to identify a song playing on the computer itself.


Mac Life , The site also includes artist bios, discographies and streaming music. The group released its album “Walk This Way” (Epic) last April, reaping only “When we do a song ID, there's always an increase in metrics, whether it's sales, The site, which is run by Atlantic Records, features an embedded imeem player on the  Free software MusicBrainz analyzes your digital music collection and fills in missing artist and song title information for your MP3's and CD's. Automatically find MP3 artist and title


Alexa now tells you the title and artist before each song plays on , f y ID CoverScout can search Amazon's music library for covers, but it doesn't match the iTunes' ability to display album artwork adds a visual element to your music and Google, which means you'll be able to find artwork for just about any song. Play. y^ 00:01:08 10MB = MPEG Layer 3 Stereo 44.1KHz Using WireTap​  Free radio for everything you do. Store 50,000 tracks from your personal collection. Subscribe for on-demand access to 40 million songs and offline listening.