Site icon Hip-Hop Website Design and Development

The right way to replace the title of audio file by way of its attachment metadata

I’m making an attempt to programmatically replace some metadata of audio file connected to a put up. I’ve been capable of replace the artist and album properties of the audio file however title does not stick. I can undergo media library and edit the title and it really works however not by way of backend. Are you able to please help? This is how I achieve this now:

              $meta = wp_get_attachment_metadata( $attachment->ID, false);

              $meta = array (
             'artist' => $mainArtist,
                     'title' => $TitleAndFeaturedArtist,
             'album' => ' ',
                            );

                    wp_update_attachment_metadata( $attachment->ID, $meta);

The artist and album will get up to date however not title. Title appears to be coming from the iD3 tag however by way of media library in wordpress, you possibly can edit and set yours. I’m making an attempt to keep away from manually processing over 2000 information. There must be a approach 🙁

Please assist. Any strategies or different would assist