12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- die('For security reasons, this demo has been disabled. It can be enabled by removing line '.__LINE__.' in demos/'.basename(__FILE__));
- $TextEncoding = 'UTF-8';
- require_once('../getid3/getid3.php');
- $getID3 = new getID3;
- $getID3->setOption(array('encoding'=>$TextEncoding));
- require_once('../getid3/write.php');
- $tagwriter = new getid3_writetags;
- $tagwriter->filename = 'c:/file.mp3';
- $tagwriter->tagformats = array('id3v2.3');
- $tagwriter->overwrite_tags = true;
- $tagwriter->remove_other_tags = false;
- $tagwriter->tag_encoding = $TextEncoding;
- $tagwriter->remove_other_tags = true;
- $TagData = array(
- 'title' => array('My Song'),
- 'artist' => array('The Artist'),
- 'album' => array('Greatest Hits'),
- 'year' => array('2004'),
- 'genre' => array('Rock'),
- 'comment' => array('excellent!'),
- 'track_number' => array('04/16'),
- 'popularimeter' => array('email'=>'user@example.net', 'rating'=>128, 'data'=>0),
- 'unique_file_identifier' => array('ownerid'=>'user@example.net', 'data'=>md5(time())),
- );
- $tagwriter->tag_data = $TagData;
- if ($tagwriter->WriteTags()) {
- echo 'Successfully wrote tags<br>';
- if (!empty($tagwriter->warnings)) {
- echo 'There were some warnings:<br>'.implode('<br><br>', $tagwriter->warnings);
- }
- } else {
- echo 'Failed to write tags!<br>'.implode('<br><br>', $tagwriter->errors);
- }
|