need a guidance to replace bulk mp3 id tags
Started on the old forum in November 2020 · view the original in the archive · old links redirect here
You could try and use: https://www.php.net/manual/en/function.scandir.php
<?php
// store a list of files inside a given folder
$mp3_files = array_diff(scandir('/path/to/mp3/folder'), array('..', '.'));
// loop through each file that was found
foreach($mp3_files as $file){
// do your bulk replace on file here...
}
I don't have a script on hand that can do bulk editing of idv3 tags but it should be relatively easy to create one.
There seems to be a nice library on GitHub: https://github.com/JamesHeinrich/getID3
I'll see what I can do.
ayesham I've attached a sample script that will look inside a
/mp3 folder and replace the idv3 tag. I created this using the library I mentioned above and some sample code that was provided so its a quick and very dirty implementation since I didn't have much time.
You'll also see the following in index.php
// populate data array
$tag_data = [
'title' => ['My Song'],
'artist' => ['The Artist'],
'album' => ['Greatest Hits'],
'year' => ['2004'],
'genre' => ['Rock'],
'comment' => ['excellent!'],
'track' => ['04/16'],
];
You can replace those with your own tags. Hope it helps.