How To Write Ratings To MP3

Post Reply
JakeSiemer
User
Posts: 8
Joined: Thu Oct 11, 2012 2:13 pm
Are you a spambot?: no

How To Write Ratings To MP3

Post by JakeSiemer » Mon Oct 15, 2012 12:59 pm

I have tried writing ratings via the 'popularimeter' tag, but no success...

$tag_data = array(
'popularimeter' => array('no@email.com', '128', '00'),
);

WriteID3v2() failed with message(s):<pre><ul><li>[email] not specified for POPM</li><li>Frame "POPM" is NOT allowed</li><li>$this->GenerateID3v2FrameData() failed for "POPM"</li><li>$this->GenerateID3v2Tag() failed</li></ul></pre>

What is the proper syntax?

I just want an easy way to send ratings to WinAmp, Windows Media Player, MediaMonkey, etc.

JakeSiemer
User
Posts: 8
Joined: Thu Oct 11, 2012 2:13 pm
Are you a spambot?: no

Re: How To Write Ratings To MP3

Post by JakeSiemer » Mon Oct 22, 2012 1:48 pm

Any takers? There has to be a way to write ratings to MP3!

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: How To Write Ratings To MP3

Post by James Heinrich » Mon Oct 22, 2012 2:09 pm

Input data requires string keys:

Code: Select all

array('email'=>'no@email.com', 'rating'=>128, 'data'=>0);

JakeSiemer
User
Posts: 8
Joined: Thu Oct 11, 2012 2:13 pm
Are you a spambot?: no

Re: How To Write Ratings To MP3

Post by JakeSiemer » Mon Nov 12, 2012 2:09 pm

Am I missing something?

I have...

Code: Select all

// POPULATE ID3 TAG DATA ARRAY
$tag_data = array(
	'title'   => array($track_title),
	'artist'  => array($track_artist),
	'band'    => array($track_author),
	'album'   => array(''),
	'year'    => array($track_year),
	'genre'   => array('Rock'),
	'comment' => array(''),
	'popularimeter' => array('email'=>'no@email.com', 'rating'=>128, 'data'=>0),
);
$tagwriter->tag_data = $tag_data;

I'm now getting the error:

Code: Select all

ERROR: Failed To Write Tags! WriteID3v2() failed with message(s):<pre><ul><li>[email] not specified for POPM</li><li>Frame "POPM" is NOT allowed</li><li>$this->GenerateID3v2FrameData() failed for "POPM"</li><li>$this->GenerateID3v2Tag() failed</li></ul></pre>
The rest of the tags write, but the rating is still blank.

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: How To Write Ratings To MP3

Post by James Heinrich » Mon Nov 12, 2012 2:35 pm

Try

Code: Select all

'popularimeter' => array(array('email'=>'no@email.com', 'rating'=>128, 'data'=>0)),

JakeSiemer
User
Posts: 8
Joined: Thu Oct 11, 2012 2:13 pm
Are you a spambot?: no

Re: How To Write Ratings To MP3

Post by JakeSiemer » Mon Nov 12, 2012 7:24 pm

With the new code you suggested I'm getting the error repeated three times...

Code: Select all

ERROR: Failed To Write Tags! WriteID3v2() failed with message(s):<pre><ul><li>[email] not specified for POPM</li><li>Frame "POPM" is NOT allowed</li><li>$this->GenerateID3v2FrameData() failed for "POPM"</li><li>$this->GenerateID3v2Tag() failed</li></ul></pre>
WriteID3v2() failed with message(s):<pre><ul><li>[email] not specified for POPM</li><li>Frame "POPM" is NOT allowed</li><li>$this->GenerateID3v2FrameData() failed for "POPM"</li><li>$this->GenerateID3v2Tag() failed</li></ul></pre>
WriteID3v2() failed with message(s):<pre><ul><li>[email] not specified for POPM</li><li>Frame "POPM" is NOT allowed</li><li>$this->GenerateID3v2FrameData() failed for "POPM"</li><li>$this->GenerateID3v2Tag() failed</li></ul></pre>
Is there any documentation on this function? Has nobody ever tried writing Ratings data to an MP3?

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: How To Write Ratings To MP3

Post by James Heinrich » Mon Nov 12, 2012 8:23 pm

It's possible the Popularimeter writing function is not working correctly. The code is more than 10 years old (written in early 2002) and could have become broken in version changes since then (or possibly it didn't work correctly even at the time of release -- I haven't personally used the feature). I'll move this to Bug Reports.

JakeSiemer
User
Posts: 8
Joined: Thu Oct 11, 2012 2:13 pm
Are you a spambot?: no

Re: How To Write Ratings To MP3

Post by JakeSiemer » Tue Nov 13, 2012 2:18 am

Thanks for your help.

Just wondering... is there any other PHP-based library out there that can do simple writing of MP3 tag data and also has support for Ratings?

I really need to get this working in the next week, as one of my web projects is going to heavily rely on the Ratings tag.

JakeSiemer
User
Posts: 8
Joined: Thu Oct 11, 2012 2:13 pm
Are you a spambot?: no

Re: How To Write Ratings To MP3

Post by JakeSiemer » Sun Nov 25, 2012 9:45 pm

Has anyone looked into this issue? Really would love to get this feature working again!

sinlyn
User
Posts: 1
Joined: Tue Jan 22, 2013 5:24 am
Are you a spambot?: no

Re: How To Write Ratings To MP3

Post by sinlyn » Tue Jan 22, 2013 6:54 am

I'm here.I'm still wondering the Popularimeter writing function.

donglin2013
User
Posts: 1
Joined: Tue Jan 29, 2013 2:09 am
Are you a spambot?: no

Re: How To Write Ratings To MP3

Post by donglin2013 » Tue Jan 29, 2013 5:34 am

I really need to get this working in the next week, as one of my web projects is going to heavily rely on the Ratings tag

JakeSiemer
User
Posts: 8
Joined: Thu Oct 11, 2012 2:13 pm
Are you a spambot?: no

Re: How To Write Ratings To MP3

Post by JakeSiemer » Mon May 26, 2014 4:01 pm

Wonder if any of the recent releases has fixed this yet? Can anyone confirm?

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: How To Write Ratings To MP3

Post by James Heinrich » Mon May 26, 2014 4:47 pm

No real changes have happened to the tag-writing code since v1.7.0 or thereabouts.

Post Reply