I used getid3_write_lyrics3 library. not working
This my code:
// Enter your filename here
$filename = 'C:\xampp\htdocs\source2\test.mp3';
//Include getID3() library (can be in a different
directory if full path is specified)
require_once('getid3.php');
// Include desired writer module
require_once('write.lyrics3.php');
//Instantiate desired tag class
$tw = new getid3_write_lyrics3($filename);
// Attempt to write new tag -- NOTE: all values must be in ISO-8859-1
try
{
$tw->title = 'bhavi';
$tw->artist = 'asas';
$tw->album = 'A new album';
$tw->author = 'bhavi author';
$tw->comment = 'bhavika commment';
$tw->images = 'C:\xampp\htdocs\source2\image.jpg';
$tw->synched = true;
$tw->lyrics = "[00:02]Let's talk about time\r\n[00:02]tickin' away
every day\r\n[00:05]so wake on up before it's gone away\r\n";
if(!$tw->write())
{
echo "not success";
}else{
print 'New tag written<br>';
}
}catch (Exception $e)
{
print $e->message;
}
OUTPUT
New tag written
but MP# file show blank MP3 Tags. show my below screenshot.
Screenshot:
Since the OP hasn't really ask for a question, and mention in a comment that he wanted to add lyrics to mp3 with id3, then I'm answering. You don't have to use lyrics3, you can just use normal id3v2.
I had similar problem to get the lyrics saved with getID3 package. It is because of a grammar issue in getID3 in file "getID3/getid3/write.id3v2.php" Line 1982 and Line 2057.
I would simply comment in of @Tom answer, but I can't comment yet. So I'm using his codes:
The key is to change 'unsynchronised_lyrics' to 'unsychronised_lyric' with their misspelling error. I opened an issue for this in JamesHeinrich getId3, so be careful when you update the package if they change it back to normal in the future so that your codes don't stop writing the lyrics.
UPDATE ---
As I received an immediate answer, the typo error was not from getID3 package, but from id3 Org directly, so it will stay as is. So use 'unsychronised_lyric' safely.