php - Can't write ID3 tags using getID3 1.9.7 -
i'm trying take advantage of wordpress' 3.6 support getid3(), i'm having trouble writing id3 tags mp3s. here code i'm using:
if ( ! class_exists( 'getid3' ) ) { require(abspath.wpinc.'/id3/getid3.php' ); } # had custom install write library because wp doesn't include default, evidently getid3_lib::includedependency(templatepath.'/lib/getid3/write.php', __file__); $testfile = "/users/jplew/sites/dev.example.com/content/uploads/mp3.mp3"; $tagwriter = new getid3_writetags; $tagwriter->filename = $testfile; $tagwriter->tagformats = array('id3v2.4'); $tagdata['title'][] = 'my heart go on'; $tagdata['artist'][] = 'celine dion'; $tagdata['genre'][] = '90s classics'; $tagwriter->tag_data = $tagdata; if ($tagwriter->writetags()) { echo 'success'; } else { echo 'failure'; }
i consistently getting 'failure'. path getid3_writetags
function fine. know because when print_r($tagwriter);
, outputs arrays specified. 'warnings' , 'errors' arrays both empty.
moreover, when following returns correct tag information:
$data = $getid3->analyze( $testfile ); print_r($data)
i should note demo.write.php
included in demos fails when run it. gets far starting write tag(s)
stops.
any ideas? i'd post on getid3.org forum ip blacklisted. :(
wordpress did not include entire getid3 library when implemented it. used files popular video , audio tags.
Comments
Post a Comment