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

5 replies · 78 views · started 6 years ago · 1 min read

2 participants
ayesham Developer · 69 posts #1

i need a help how to bulk replace mp3 id3 tags from getid3 script in a specific folder

root host specific folder name = mp3 ( all mp3 will store in this folder)

s2k Junior · 11 posts #2

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...
}
ayesham Developer · 69 posts #3

bro can you send me full php mp3 id edit script.

mp3 file location is ../system/mp3/

i want to remove all tags and replace with my own tags

s2k Junior · 11 posts #4

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.

s2k Junior · 11 posts #5

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.

Attachments: idv3.zip
ayesham Developer · 69 posts #6

thanks bro it woks well

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close