Jump to content

getID3 Write ETCO tags


bschultz

Recommended Posts

I've started to dabble with getID3 to write tags for use with a given audio program we use at the radio station I work for.  The program uses id3v2.3 tags for frame_name ETCO:

Here's the code that getID3 uses for handling ETCO tags:

 

		} elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ETCO')) || // 4.5   ETCO Event timing codes
				(($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ETC'))) {     // 4.6   ETC  Event timing codes
			//   There may only be one 'ETCO' frame in each tag
			// <Header for 'Event timing codes', ID: 'ETCO'>
			// Time stamp format    $xx
			//   Where time stamp format is:
			// $01  (32-bit value) MPEG frames from beginning of file
			// $02  (32-bit value) milliseconds from beginning of file
			//   Followed by a list of key events in the following format:
			// Type of event   $xx
			// Time stamp      $xx (xx ...)
			//   The 'Time stamp' is set to zero if directly at the beginning of the sound
			//   or after the previous event. All events MUST be sorted in chronological order.

			$frame_offset = 0;
			$parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));

			while ($frame_offset < strlen($parsedFrame['data'])) {
				$parsedFrame['typeid']    = substr($parsedFrame['data'], $frame_offset++, 1);
				$parsedFrame['type']      = $this->ETCOEventLookup($parsedFrame['typeid']);
				$parsedFrame['timestamp'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
				$frame_offset += 4;
			}
			unset($parsedFrame['data']);


This says that I'm to include $parsedFrame['data'] as one of the array items.  The standard does not list a data field.  Also, the standard says that the value of timestamp should be HEX.  So, do I put 0011 in for 3 milliseconds or do I put 3 as the vale of timestamp?

The documentation for ETCO tags is pretty scarce...so, what I'm trying to ask is how do I write an 1d3v2.3 ETCO array for getID3?

Here's version 50 of what I've tried, and it doesn't work.
 

$TagData['id3v2']['ETCO']['frame_name'] = 'ETCO';
$TagData['id3v2']['ETCO']['data'] = 3;  // from the standard at https://id3.org/id3v2.3.0#sec4.6
$TagData['id3v2']['ETCO']['type'] = 3;  // type 3 is mainpart start
$TagData['id3v2']['ETCO']['timestamp'] = 1000; // milliseconds 
$TagData['id3v2']['ETCO']['timestampformat'] = 2; // timestamp format #2 which is Absolute time, 32 bit sized, using milliseconds as unit

$TagData['id3v2']['ETCO']['data'] = 4;  // from the standard at https://id3.org/id3v2.3.0#sec4.6
$TagData['id3v2']['ETCO']['type'] = 4;  // type 4 is outro start
$TagData['id3v2']['ETCO']['timestamp'] = 1500;  // milliseconds 
$TagData['id3v2']['ETCO']['timestampformat'] = 2; // timestamp format #2 which is Absolute time, 32 bit sized, using milliseconds as unit



Thanks!

Link to comment
Share on other sites

What library are you using to write the tags? Does it actually use arrays with stuff like "timestamp" and "timestampformat"? Because that code sample you have there uses an associative array and thus will only allow a single timing code.

If you're supposed to specify a "frame_name" and "data", which is basically the minimum, then the data would be the full frame data. Presumably raw bytes. So "\x02" (format) + "\x03\x00\x00\x03\xE8" (event 3, timestamp 0x000003E8ms) + additional timing codes.

Link to comment
Share on other sites

Good thing about PHP is that it's open-source, so you can look at the library to see how it handles ETCO data.

Bad news is that it's a bit perverse about the structure of the array. You specify a "timestampformat" key, and potentially "flags", but then everything else is more arrays. Those are where you add the "timestamp" and "typeid" values.

$TagData['id3v2']['ETCO'] = [
	"timestampformat" => 2,
	["typeid" => 3, "timestamp" => 1000],
	["typeid" => 4, "timestamp" => 1500],
	// etc
];

 

Link to comment
Share on other sites

35 minutes ago, bschultz said:

Thanks for the help...I hate that there's no real documentation.  The $TagData array that you created did NOT write the tags either.  I've tried a lot of different ways to construct this array...with no success.

Did you check if there were any errors reported by the library? Because I'm pretty sure I see a bug in it.

Link to comment
Share on other sites

This is the standard getID3 code for submitting the data...which calls the warning and errors reported back...and it reported nothing.

 

$tagwriter->tag_data = $TagData;

// write tags
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);
}

 

Link to comment
Share on other sites

It's been at least a decade since I played around with the getid3 library. I'll be honest, I have no idea what ETCO tag data is. But, I have a possible solution. Do you have a file with existing ETCO tags or is there a tag editing application that you can use to set such tags? If you have a file with example tag data that you know what it represents, then instead of using getid3 to set the data, use it to get the data. You can then see what the format of the data is that it expects. I remember doing something similar for some other tag information at the time.

  • Like 1
Link to comment
Share on other sites

I won't ever have to GET the tags...once they're set, I don't have to touch the file again.  The biggest problem is our radio automation system is a Mac program.  The only way to set the tags on our Mac is to play the file...in real time...and press the space bar to set the intro and outro tags.  That's how the Mac program works.  Not time efficient at all!

Here's what getID3 reported back for a file with the tags as written by the Mac:

 

Array
(
    [GETID3_VERSION] => 1.9.20-202107131440
    [filesize] => 258297
    [filepath] => /home/brian/Desktop
    [filename] => 1.mp3
    [filenamepath] => /home/brian/Desktop/1.mp3
    [avdataoffset] => 4178
    [avdataend] => 258297
    [fileformat] => mp3
    [audio] => Array
        (
            [dataformat] => mp3
            [channels] => 2
            [sample_rate] => 44100
            [bitrate] => 128000
            [channelmode] => stereo
            [bitrate_mode] => cbr
            [lossless] => 
            [encoder_options] => CBR128
            [compression_ratio] => 0.090702947845805
            [streams] => Array
                (
                    [0] => Array
                        (
                            [dataformat] => mp3
                            [channels] => 2
                            [sample_rate] => 44100
                            [bitrate] => 128000
                            [channelmode] => stereo
                            [bitrate_mode] => cbr
                            [lossless] => 
                            [encoder_options] => CBR128
                            [compression_ratio] => 0.090702947845805
                        )

                )

        )

    [tags] => Array
        (
            [id3v2] => Array
                (
                    [title] => Array
                        (
                            [0] => 1.mp3
                        )

                    [genre] => Array
                        (
                            [0] => Dance
                        )

                )

        )

    [warning] => Array
        (
            [0] => Unknown data before synch (ID3v2 header ends at 4096, then 82 bytes garbage, synch detected at 4178)
        )

    [encoding] => UTF-8
    [id3v2] => Array
        (
            [header] => 1
            [flags] => Array
                (
                    [unsynch] => 
                    [exthead] => 
                    [experim] => 
                )

            [majorversion] => 3
            [minorversion] => 0
            [headerlength] => 4096
            [tag_offset_start] => 0
            [tag_offset_end] => 4096
            [encoding] => UTF-8
            [comments] => Array
                (
                    [title] => Array
                        (
                            [0] => 1.mp3
                        )

                    [genre] => Array
                        (
                            [0] => Dance
                        )

                )

            [TIT2] => Array
                (
                    [0] => Array
                        (
                            [frame_name] => TIT2
                            [frame_flags_raw] => 0
                            [data] => 1.mp3
                            [datalength] => 7
                            [dataoffset] => 10
                            [framenamelong] => Title/songname/content description
                            [framenameshort] => title
                            [flags] => Array
                                (
                                    [TagAlterPreservation] => 
                                    [FileAlterPreservation] => 
                                    [ReadOnly] => 
                                    [compression] => 
                                    [Encryption] => 
                                    [GroupingIdentity] => 
                                )

                            [encodingid] => 0
                            [encoding] => ISO-8859-1
                        )

                )

            [TCON] => Array
                (
                    [0] => Array
                        (
                            [frame_name] => TCON
                            [frame_flags_raw] => 0
                            [data] =>  3
                            [datalength] => 4
                            [dataoffset] => 27
                            [framenamelong] => Content type
                            [framenameshort] => genre
                            [flags] => Array
                                (
                                    [TagAlterPreservation] => 
                                    [FileAlterPreservation] => 
                                    [ReadOnly] => 
                                    [compression] => 
                                    [Encryption] => 
                                    [GroupingIdentity] => 
                                )

                            [encodingid] => 0
                            [encoding] => ISO-8859-1
                        )

                )

            [ETCO] => Array
                (
                    [0] => Array
                        (
                            [frame_name] => ETCO
                            [frame_flags_raw] => 0
                            [datalength] => 12
                            [dataoffset] => 41
                            [framenamelong] => Event timing codes
                            [framenameshort] => event_timing_codes
                            [flags] => Array
                                (
                                    [TagAlterPreservation] => 
                                    [FileAlterPreservation] => 
                                    [ReadOnly] => 
                                    [compression] => 
                                    [Encryption] => 
                                    [GroupingIdentity] => 
                                )

                            [timestampformat] => 2
                            [typeid] => 
                            [type] => 
                            [timestamp] => 
                        )

                )

            [PRIV] => Array
                (
                    [0] => Array
                        (
                            [frame_name] => PRIV
                            [frame_flags_raw] => 0
                            [data] => 
                            [datalength] => 4023
                            [dataoffset] => 63
                            [framenamelong] => Private frame
                            [framenameshort] => private_frame
                            [flags] => Array
                                (
                                    [TagAlterPreservation] => 
                                    [FileAlterPreservation] => 
                                    [ReadOnly] => 
                                    [compression] => 
                                    [Encryption] => 
                                    [GroupingIdentity] => 
                                )

                            [ownerid] => 
                        )

                )

        )

    [mime_type] => audio/mpeg
    [mpeg] => Array
        (
            [audio] => Array
                (
                    [raw] => Array
                        (
                            [synch] => 4094
                            [version] => 3
                            [layer] => 1
                            [protection] => 1
                            [bitrate] => 9
                            [sample_rate] => 0
                            [padding] => 1
                            [private] => 0
                            [channelmode] => 0
                            [modeextension] => 0
                            [copyright] => 0
                            [original] => 1
                            [emphasis] => 0
                        )

                    [version] => 1
                    [layer] => 3
                    [channelmode] => stereo
                    [channels] => 2
                    [sample_rate] => 44100
                    [protection] => 
                    [private] => 
                    [modeextension] => 
                    [copyright] => 
                    [original] => 1
                    [emphasis] => none
                    [padding] => 1
                    [bitrate] => 128000
                    [framelength] => 418
                    [bitrate_mode] => cbr
                )

        )

    [playtime_seconds] => 15.8824375
    [tags_html] => Array
        (
            [id3v2] => Array
                (
                    [title] => Array
                        (
                            [0] => 1.mp3
                        )

                    [genre] => Array
                        (
                            [0] => Dance
                        )

                )

        )

    [bitrate] => 128000
    [playtime_string] => 0:16
)

Oddly enough, there's a warning on line 61...and the tags I'm expecting to see under ETCO are blank!  Maybe this library can't even read these tags properly...much less write them!

                            [timestampformat] => 2
                            [typeid] =>
                            [type] =>
                            [timestamp] =>

Link to comment
Share on other sites

If you want to see the raw tags for yourself, the file is at http://brian-schultz.com/1.mp3

Here's the var_dump

 

array(19) {
  ["GETID3_VERSION"]=>
  string(19) "1.9.20-202107131440"
  ["filesize"]=>
  int(258297)
  ["filepath"]=>
  string(19) "/home/brian/Desktop"
  ["filename"]=>
  string(5) "1.mp3"
  ["filenamepath"]=>
  string(25) "/home/brian/Desktop/1.mp3"
  ["avdataoffset"]=>
  int(4178)
  ["avdataend"]=>
  int(258297)
  ["fileformat"]=>
  string(3) "mp3"
  ["audio"]=>
  array(10) {
    ["dataformat"]=>
    string(3) "mp3"
    ["channels"]=>
    int(2)
    ["sample_rate"]=>
    int(44100)
    ["bitrate"]=>
    int(128000)
    ["channelmode"]=>
    string(6) "stereo"
    ["bitrate_mode"]=>
    string(3) "cbr"
    ["lossless"]=>
    bool(false)
    ["encoder_options"]=>
    string(6) "CBR128"
    ["compression_ratio"]=>
    float(0.090702947845805)
    ["streams"]=>
    array(1) {
      [0]=>
      array(9) {
        ["dataformat"]=>
        string(3) "mp3"
        ["channels"]=>
        int(2)
        ["sample_rate"]=>
        int(44100)
        ["bitrate"]=>
        int(128000)
        ["channelmode"]=>
        string(6) "stereo"
        ["bitrate_mode"]=>
        string(3) "cbr"
        ["lossless"]=>
        bool(false)
        ["encoder_options"]=>
        string(6) "CBR128"
        ["compression_ratio"]=>
        float(0.090702947845805)
      }
    }
  }
  ["tags"]=>
  array(1) {
    ["id3v2"]=>
    array(2) {
      ["title"]=>
      array(1) {
        [0]=>
        string(5) "1.mp3"
      }
      ["genre"]=>
      array(1) {
        [0]=>
        string(5) "Dance"
      }
    }
  }
  ["warning"]=>
  array(1) {
    [0]=>
    string(100) "Unknown data before synch (ID3v2 header ends at 4096, then 82 bytes garbage, synch detected at 4178)"
  }
  ["encoding"]=>
  string(5) "UTF-8"
  ["id3v2"]=>
  array(13) {
    ["header"]=>
    bool(true)
    ["flags"]=>
    array(3) {
      ["unsynch"]=>
      bool(false)
      ["exthead"]=>
      bool(false)
      ["experim"]=>
      bool(false)
    }
    ["majorversion"]=>
    int(3)
    ["minorversion"]=>
    int(0)
    ["headerlength"]=>
    int(4096)
    ["tag_offset_start"]=>
    int(0)
    ["tag_offset_end"]=>
    int(4096)
    ["encoding"]=>
    string(5) "UTF-8"
    ["comments"]=>
    array(2) {
      ["title"]=>
      array(1) {
        [0]=>
        string(5) "1.mp3"
      }
      ["genre"]=>
      array(1) {
        [0]=>
        string(5) "Dance"
      }
    }
    ["TIT2"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TIT2"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(5) "1.mp3"
        ["datalength"]=>
        int(7)
        ["dataoffset"]=>
        int(10)
        ["framenamelong"]=>
        string(34) "Title/songname/content description"
        ["framenameshort"]=>
        string(5) "title"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["TCON"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TCON"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(2) " 3"
        ["datalength"]=>
        int(4)
        ["dataoffset"]=>
        int(27)
        ["framenamelong"]=>
        string(12) "Content type"
        ["framenameshort"]=>
        string(5) "genre"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["ETCO"]=>
    array(1) {
      [0]=>
      array(11) {
        ["frame_name"]=>
        string(4) "ETCO"
        ["frame_flags_raw"]=>
        int(0)
        ["datalength"]=>
        int(12)
        ["dataoffset"]=>
        int(41)
        ["framenamelong"]=>
        string(18) "Event timing codes"
        ["framenameshort"]=>
        string(18) "event_timing_codes"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["timestampformat"]=>
        int(2)
        ["typeid"]=>
        string(1) ""
        ["type"]=>
        string(0) ""
        ["timestamp"]=>
        bool(false)
      }
    }
    ["PRIV"]=>
    array(1) {
      [0]=>
      array(9) {
        ["frame_name"]=>
        string(4) "PRIV"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(4022) ""
        ["datalength"]=>
        int(4023)
        ["dataoffset"]=>
        int(63)
        ["framenamelong"]=>
        string(13) "Private frame"
        ["framenameshort"]=>
        string(13) "private_frame"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["ownerid"]=>
        string(0) ""
      }
    }
  }
  ["mime_type"]=>
  string(10) "audio/mpeg"
  ["mpeg"]=>
  array(1) {
    ["audio"]=>
    array(16) {
      ["raw"]=>
      array(13) {
        ["synch"]=>
        int(4094)
        ["version"]=>
        int(3)
        ["layer"]=>
        int(1)
        ["protection"]=>
        int(1)
        ["bitrate"]=>
        int(9)
        ["sample_rate"]=>
        int(0)
        ["padding"]=>
        int(1)
        ["private"]=>
        int(0)
        ["channelmode"]=>
        int(0)
        ["modeextension"]=>
        int(0)
        ["copyright"]=>
        int(0)
        ["original"]=>
        int(1)
        ["emphasis"]=>
        int(0)
      }
      ["version"]=>
      string(1) "1"
      ["layer"]=>
      int(3)
      ["channelmode"]=>
      string(6) "stereo"
      ["channels"]=>
      int(2)
      ["sample_rate"]=>
      int(44100)
      ["protection"]=>
      bool(false)
      ["private"]=>
      bool(false)
      ["modeextension"]=>
      string(0) ""
      ["copyright"]=>
      bool(false)
      ["original"]=>
      bool(true)
      ["emphasis"]=>
      string(4) "none"
      ["padding"]=>
      bool(true)
      ["bitrate"]=>
      int(128000)
      ["framelength"]=>
      int(418)
      ["bitrate_mode"]=>
      string(3) "cbr"
    }
  }
  ["playtime_seconds"]=>
  float(15.8824375)
  ["tags_html"]=>
  array(1) {
    ["id3v2"]=>
    array(2) {
      ["title"]=>
      array(1) {
        [0]=>
        string(5) "1.mp3"
      }
      ["genre"]=>
      array(1) {
        [0]=>
        string(5) "Dance"
      }
    }
  }
  ["bitrate"]=>
  int(128000)
  ["playtime_string"]=>
  string(4) "0:16"
}

 

Link to comment
Share on other sites

Pull up your local copy of getID3's write.id3v2.php, jump down to the section about ETCO, and edit the first line of

							if (!$this->ID3v2IsValidETCOevent($val['typeid'])) {
								$this->errors[] = 'Invalid Event Type byte in '.$frame_name.' ('.$val['typeid'].')';
							} elseif (($key != 'timestampformat') && ($key != 'flags')) {

to be

if (is_array($val) && !$this->ID3v2IsValidETCOevent($val['typeid'])) {

You know. For the fun of it.

When you say it doesn't write tags, does it not write any tags? Or writes tags except for the ETCO? What if you omit the ETCO tag and try to do everything else?

Link to comment
Share on other sites

It does write other tags...normal ones like artist, title, year, etc...but not ETCo tags.  The change to the write.id3v2.php did NOT write these tags.  here's the new var_dump

array(19) {
  ["GETID3_VERSION"]=>
  string(19) "1.9.20-202107131440"
  ["filesize"]=>
  int(181019)
  ["filepath"]=>
  string(19) "/home/brian/Desktop"
  ["filename"]=>
  string(5) "1.mp3"
  ["filenamepath"]=>
  string(25) "/home/brian/Desktop/1.mp3"
  ["avdataoffset"]=>
  int(4096)
  ["avdataend"]=>
  int(180891)
  ["fileformat"]=>
  string(3) "mp3"
  ["audio"]=>
  array(12) {
    ["dataformat"]=>
    string(3) "mp3"
    ["channels"]=>
    int(2)
    ["sample_rate"]=>
    int(44100)
    ["bitrate"]=>
    int(128000)
    ["channelmode"]=>
    string(6) "stereo"
    ["bitrate_mode"]=>
    string(3) "cbr"
    ["codec"]=>
    string(4) "LAME"
    ["encoder"]=>
    string(9) "LAME3.99r"
    ["lossless"]=>
    bool(false)
    ["encoder_options"]=>
    string(6) "CBR128"
    ["compression_ratio"]=>
    float(0.090702947845805)
    ["streams"]=>
    array(1) {
      [0]=>
      array(11) {
        ["dataformat"]=>
        string(3) "mp3"
        ["channels"]=>
        int(2)
        ["sample_rate"]=>
        int(44100)
        ["bitrate"]=>
        int(128000)
        ["channelmode"]=>
        string(6) "stereo"
        ["bitrate_mode"]=>
        string(3) "cbr"
        ["codec"]=>
        string(4) "LAME"
        ["encoder"]=>
        string(9) "LAME3.99r"
        ["lossless"]=>
        bool(false)
        ["encoder_options"]=>
        string(6) "CBR128"
        ["compression_ratio"]=>
        float(0.090702947845805)
      }
    }
  }
  ["tags"]=>
  array(2) {
    ["id3v1"]=>
    array(4) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
    }
    ["id3v2"]=>
    array(5) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
      ["genre"]=>
      array(1) {
        [0]=>
        string(5) "Dance"
      }
    }
  }
  ["encoding"]=>
  string(5) "UTF-8"
  ["id3v2"]=>
  array(15) {
    ["header"]=>
    bool(true)
    ["flags"]=>
    array(3) {
      ["unsynch"]=>
      bool(false)
      ["exthead"]=>
      bool(false)
      ["experim"]=>
      bool(false)
    }
    ["majorversion"]=>
    int(3)
    ["minorversion"]=>
    int(0)
    ["headerlength"]=>
    int(4096)
    ["tag_offset_start"]=>
    int(0)
    ["tag_offset_end"]=>
    int(4096)
    ["encoding"]=>
    string(5) "UTF-8"
    ["comments"]=>
    array(5) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
      ["genre"]=>
      array(1) {
        [0]=>
        string(5) "Dance"
      }
    }
    ["TIT2"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TIT2"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(7) "My Song"
        ["datalength"]=>
        int(8)
        ["dataoffset"]=>
        int(10)
        ["framenamelong"]=>
        string(34) "Title/songname/content description"
        ["framenameshort"]=>
        string(5) "title"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["TPE1"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TPE1"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(10) "The Artist"
        ["datalength"]=>
        int(11)
        ["dataoffset"]=>
        int(28)
        ["framenamelong"]=>
        string(28) "Lead performer(s)/Soloist(s)"
        ["framenameshort"]=>
        string(6) "artist"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["TALB"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TALB"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(13) "Greatest Hits"
        ["datalength"]=>
        int(14)
        ["dataoffset"]=>
        int(49)
        ["framenamelong"]=>
        string(22) "Album/Movie/Show title"
        ["framenameshort"]=>
        string(5) "album"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["TYER"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TYER"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(4) "2004"
        ["datalength"]=>
        int(5)
        ["dataoffset"]=>
        int(73)
        ["framenamelong"]=>
        string(4) "Year"
        ["framenameshort"]=>
        string(4) "year"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["TCON"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TCON"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(1) "3"
        ["datalength"]=>
        int(2)
        ["dataoffset"]=>
        int(88)
        ["framenamelong"]=>
        string(12) "Content type"
        ["framenameshort"]=>
        string(5) "genre"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["padding"]=>
    array(3) {
      ["start"]=>
      int(100)
      ["length"]=>
      int(3996)
      ["valid"]=>
      bool(true)
    }
  }
  ["id3v1"]=>
  array(10) {
    ["title"]=>
    string(7) "My Song"
    ["artist"]=>
    string(10) "The Artist"
    ["album"]=>
    string(13) "Greatest Hits"
    ["year"]=>
    string(4) "2004"
    ["comment"]=>
    string(0) ""
    ["comments"]=>
    array(5) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
      ["comment"]=>
      array(1) {
        [0]=>
        string(0) ""
      }
    }
    ["padding_valid"]=>
    bool(true)
    ["tag_offset_end"]=>
    int(181019)
    ["tag_offset_start"]=>
    int(180891)
    ["encoding"]=>
    string(10) "ISO-8859-1"
  }
  ["mime_type"]=>
  string(10) "audio/mpeg"
  ["mpeg"]=>
  array(1) {
    ["audio"]=>
    array(23) {
      ["raw"]=>
      array(13) {
        ["synch"]=>
        int(4094)
        ["version"]=>
        int(3)
        ["layer"]=>
        int(1)
        ["protection"]=>
        int(1)
        ["bitrate"]=>
        int(9)
        ["sample_rate"]=>
        int(0)
        ["padding"]=>
        int(0)
        ["private"]=>
        int(0)
        ["channelmode"]=>
        int(0)
        ["modeextension"]=>
        int(0)
        ["copyright"]=>
        int(0)
        ["original"]=>
        int(1)
        ["emphasis"]=>
        int(0)
      }
      ["version"]=>
      string(1) "1"
      ["layer"]=>
      int(3)
      ["channelmode"]=>
      string(6) "stereo"
      ["channels"]=>
      int(2)
      ["sample_rate"]=>
      int(44100)
      ["protection"]=>
      bool(false)
      ["private"]=>
      bool(false)
      ["modeextension"]=>
      string(0) ""
      ["copyright"]=>
      bool(false)
      ["original"]=>
      bool(true)
      ["emphasis"]=>
      string(4) "none"
      ["padding"]=>
      bool(false)
      ["bitrate"]=>
      int(128000)
      ["framelength"]=>
      float(418)
      ["bitrate_mode"]=>
      string(3) "cbr"
      ["VBR_method"]=>
      string(4) "Xing"
      ["xing_flags_raw"]=>
      int(15)
      ["xing_flags"]=>
      array(4) {
        ["frames"]=>
        bool(true)
        ["bytes"]=>
        bool(true)
        ["toc"]=>
        bool(true)
        ["vbr_scale"]=>
        bool(true)
      }
      ["VBR_frames"]=>
      int(422)
      ["VBR_bytes"]=>
      int(176795)
      ["toc"]=>
      array(100) {
        [0]=>
        int(0)
        [1]=>
        int(3)
        [2]=>
        int(6)
        [3]=>
        int(8)
        [4]=>
        int(10)
        [5]=>
        int(13)
        [6]=>
        int(15)
        [7]=>
        int(18)
        [8]=>
        int(20)
        [9]=>
        int(23)
        [10]=>
        int(26)
        [11]=>
        int(29)
        [12]=>
        int(31)
        [13]=>
        int(33)
        [14]=>
        int(36)
        [15]=>
        int(38)
        [16]=>
        int(41)
        [17]=>
        int(43)
        [18]=>
        int(46)
        [19]=>
        int(49)
        [20]=>
        int(52)
        [21]=>
        int(54)
        [22]=>
        int(57)
        [23]=>
        int(59)
        [24]=>
        int(61)
        [25]=>
        int(64)
        [26]=>
        int(66)
        [27]=>
        int(69)
        [28]=>
        int(72)
        [29]=>
        int(75)
        [30]=>
        int(77)
        [31]=>
        int(80)
        [32]=>
        int(82)
        [33]=>
        int(84)
        [34]=>
        int(87)
        [35]=>
        int(89)
        [36]=>
        int(92)
        [37]=>
        int(95)
        [38]=>
        int(98)
        [39]=>
        int(100)
        [40]=>
        int(103)
        [41]=>
        int(105)
        [42]=>
        int(107)
        [43]=>
        int(110)
        [44]=>
        int(112)
        [45]=>
        int(115)
        [46]=>
        int(118)
        [47]=>
        int(121)
        [48]=>
        int(123)
        [49]=>
        int(126)
        [50]=>
        int(128)
        [51]=>
        int(131)
        [52]=>
        int(133)
        [53]=>
        int(135)
        [54]=>
        int(138)
        [55]=>
        int(141)
        [56]=>
        int(144)
        [57]=>
        int(146)
        [58]=>
        int(149)
        [59]=>
        int(151)
        [60]=>
        int(154)
        [61]=>
        int(156)
        [62]=>
        int(158)
        [63]=>
        int(161)
        [64]=>
        int(165)
        [65]=>
        int(167)
        [66]=>
        int(169)
        [67]=>
        int(172)
        [68]=>
        int(174)
        [69]=>
        int(177)
        [70]=>
        int(179)
        [71]=>
        int(181)
        [72]=>
        int(184)
        [73]=>
        int(188)
        [74]=>
        int(190)
        [75]=>
        int(192)
        [76]=>
        int(195)
        [77]=>
        int(197)
        [78]=>
        int(200)
        [79]=>
        int(202)
        [80]=>
        int(205)
        [81]=>
        int(207)
        [82]=>
        int(211)
        [83]=>
        int(213)
        [84]=>
        int(215)
        [85]=>
        int(218)
        [86]=>
        int(220)
        [87]=>
        int(223)
        [88]=>
        int(225)
        [89]=>
        int(228)
        [90]=>
        int(230)
        [91]=>
        int(234)
        [92]=>
        int(236)
        [93]=>
        int(239)
        [94]=>
        int(241)
        [95]=>
        int(243)
        [96]=>
        int(246)
        [97]=>
        int(248)
        [98]=>
        int(251)
        [99]=>
        int(253)
      }
      ["LAME"]=>
      array(24) {
        ["short_version"]=>
        string(9) "LAME3.99r"
        ["numeric_version"]=>
        string(5) "3.99r"
        ["integer_version"]=>
        array(2) {
          [0]=>
          int(3)
          [1]=>
          int(99)
        }
        ["raw"]=>
        array(10) {
          ["vbr_method"]=>
          int(1)
          ["RGAD_track"]=>
          int(0)
          ["RGAD_album"]=>
          int(0)
          ["abrbitrate_minbitrate"]=>
          int(128)
          ["noise_shaping"]=>
          int(2)
          ["stereo_mode"]=>
          int(1)
          ["not_optimal_quality"]=>
          int(0)
          ["source_sample_freq"]=>
          int(1)
          ["mp3_gain"]=>
          int(0)
          ["surround_info"]=>
          int(0)
        }
        ["vbr_quality"]=>
        int(57)
        ["tag_revision"]=>
        int(0)
        ["vbr_method"]=>
        string(3) "cbr"
        ["lowpass_frequency"]=>
        int(17000)
        ["encoding_flags"]=>
        array(4) {
          ["nspsytune"]=>
          bool(true)
          ["nssafejoint"]=>
          bool(false)
          ["nogap_next"]=>
          bool(false)
          ["nogap_prev"]=>
          bool(false)
        }
        ["ath_type"]=>
        int(4)
        ["encoder_delay"]=>
        int(576)
        ["end_padding"]=>
        int(1088)
        ["noise_shaping"]=>
        int(2)
        ["stereo_mode"]=>
        string(6) "stereo"
        ["not_optimal_quality"]=>
        bool(false)
        ["source_sample_freq"]=>
        string(8) "44.1 kHz"
        ["mp3_gain_db"]=>
        float(0)
        ["mp3_gain_factor"]=>
        float(1)
        ["surround_info"]=>
        string(16) "no surround info"
        ["preset_used_id"]=>
        int(128)
        ["preset_used"]=>
        string(20) "--alt-preset cbr 128"
        ["audio_bytes"]=>
        int(176795)
        ["music_crc"]=>
        int(33268)
        ["lame_tag_crc"]=>
        int(56695)
      }
    }
  }
  ["playtime_seconds"]=>
  float(11.0235625)
  ["tags_html"]=>
  array(2) {
    ["id3v1"]=>
    array(4) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
    }
    ["id3v2"]=>
    array(5) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
      ["genre"]=>
      array(1) {
        [0]=>
        string(5) "Dance"
      }
    }
  }
  ["bitrate"]=>
  int(128000)
  ["playtime_string"]=>
  string(4) "0:11"
}

 

Link to comment
Share on other sites

3 hours ago, bschultz said:

It does write other tags...normal ones like artist, title, year, etc...but not ETCo tags.

I don't see how that can be...

What's the full code you have, covering the part where you set up the tag data and the part where you use the library to write it, as well as everything in between?

Link to comment
Share on other sites

<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org>               //
//  available at https://github.com/JamesHeinrich/getID3       //
//            or https://www.getid3.org                        //
//            or http://getid3.sourceforge.net                 //
//                                                             //
// /demo/demo.simple.write.php - part of getID3()              //
// Sample script showing basic syntax for writing tags         //
//  see readme.txt for more details                            //
//                                                            ///
/////////////////////////////////////////////////////////////////

//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('/home/brian/getID3/getid3/getid3.php');
// Initialize getID3 engine
$getID3 = new getID3;
$getID3->setOption(array('encoding'=>$TextEncoding));

require_once('/home/brian/getID3/getid3/write.php');
// Initialize getID3 tag-writing module
$tagwriter = new getid3_writetags;

$tagwriter->filename = '/home/brian/Desktop/1.mp3';

$tagwriter->tagformats = array('id3v1', 'id3v2.3');

// set various options (optional)
$tagwriter->overwrite_tags    = true;  // if true will erase existing tag data and write only passed data; if false will merge passed data with existing tag data (experimental)
$tagwriter->remove_other_tags = true; // if true removes other tag formats (e.g. ID3v1, ID3v2, APE, Lyrics3, etc) that may be present in the file and only write the specified tag format(s). If false leaves any unspecified tag formats as-is.
$tagwriter->tag_encoding      = $TextEncoding;


// populate data array
$TagData = array(
	'title'                  => array('My Song'),
	'artist'                 => array('The Artist'),
	'album'                  => array('Greatest Hits'),
	'year'                   => array('2004'),
	'genre'                  => array('3')
);



$TagData['id3v2']['ETCO'] = [
	"timestampformat" => 2,
	["typeid" => 3, "timestamp" => 1000],
	["typeid" => 4, "timestamp" => 1500],
	// etc
];


/*

other ways I've tried

$TagData['id3v2'][0] = array(
'frame_name' => 'ETCO', 
'data' => 3,
'type' => 3,
'timestamp' => 1000,
'framenamelong' => 'Event Timing Codes',
'framenameshort' => 'event timing codes',
'timestampformat' => '2'
);

$TagData['id3v2'][0] = array(
'frame_name' => 'ETCO', 
'data' => 4,
'type' => 4,
'timestamp' => 1500,
'framenamelong' => 'Event Timing Codes',
'framenameshort' => 'event timing codes',
'timestampformat' => '2'
);





$TagData['id3v2']['ETCO']['frame_name'] = 'ETCO';
$TagData['id3v2']['ETCO']['data'] = 3;  // from the standard at https://id3.org/id3v2.3.0#sec4.6
$TagData['id3v2']['ETCO']['type'] = 3;  // type 3 is mainpart start
$TagData['id3v2']['ETCO']['timestamp'] = 1000; // milliseconds 
$TagData['id3v2']['ETCO']['timestampformat'] = 2; // timestamp format #2 which is Absolute time, 32 bit sized, using milliseconds as unit

$TagData['id3v2']['ETCO']['data'] = 4;  // from the standard at https://id3.org/id3v2.3.0#sec4.6
$TagData['id3v2']['ETCO']['type'] = 4;  // type 4 is outro start
$TagData['id3v2']['ETCO']['timestamp'] = 1500;  // milliseconds 
$TagData['id3v2']['ETCO']['timestampformat'] = 2; // timestamp format #2 which is Absolute time, 32 bit sized, using milliseconds as unit




$TagData['id3v2'][0]['TCON']['frame_flags_raw'] = 0; 
$TagData['id3v2'][0]['TCON']['data'] = 3;
$TagData['id3v2'][0]['TCON']['datalength'] = 4;
$TagData['id3v2'][0]['TCON']['dataoffset'] = 55;
$TagData['id3v2'][0]['TCON']['framenameshort'] = 'genre';



 */










$tagwriter->tag_data = $TagData;

// write tags
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);
}

?>

 

Link to comment
Share on other sites

NO ETCO tags written...new var dump.  This is the only tag writer I've seen that even mentions ETCO tags or I would have tried something else a LONG time ago!

Thank you for this!

 

array(19) {
  ["GETID3_VERSION"]=>
  string(19) "1.9.20-202107131440"
  ["filesize"]=>
  int(262521)
  ["filepath"]=>
  string(19) "/home/brian/Desktop"
  ["filename"]=>
  string(5) "1.mp3"
  ["filenamepath"]=>
  string(25) "/home/brian/Desktop/1.mp3"
  ["avdataoffset"]=>
  int(4096)
  ["avdataend"]=>
  int(262393)
  ["fileformat"]=>
  string(3) "mp3"
  ["audio"]=>
  array(12) {
    ["dataformat"]=>
    string(3) "mp3"
    ["channels"]=>
    int(2)
    ["sample_rate"]=>
    int(44100)
    ["bitrate"]=>
    int(128000)
    ["channelmode"]=>
    string(6) "stereo"
    ["bitrate_mode"]=>
    string(3) "cbr"
    ["codec"]=>
    string(4) "LAME"
    ["encoder"]=>
    string(9) "LAME3.100"
    ["lossless"]=>
    bool(false)
    ["encoder_options"]=>
    string(6) "CBR128"
    ["compression_ratio"]=>
    float(0.090702947845805)
    ["streams"]=>
    array(1) {
      [0]=>
      array(11) {
        ["dataformat"]=>
        string(3) "mp3"
        ["channels"]=>
        int(2)
        ["sample_rate"]=>
        int(44100)
        ["bitrate"]=>
        int(128000)
        ["channelmode"]=>
        string(6) "stereo"
        ["bitrate_mode"]=>
        string(3) "cbr"
        ["codec"]=>
        string(4) "LAME"
        ["encoder"]=>
        string(9) "LAME3.100"
        ["lossless"]=>
        bool(false)
        ["encoder_options"]=>
        string(6) "CBR128"
        ["compression_ratio"]=>
        float(0.090702947845805)
      }
    }
  }
  ["tags"]=>
  array(2) {
    ["id3v1"]=>
    array(4) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
    }
    ["id3v2"]=>
    array(5) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
      ["genre"]=>
      array(1) {
        [0]=>
        string(5) "Dance"
      }
    }
  }
  ["encoding"]=>
  string(5) "UTF-8"
  ["id3v2"]=>
  array(15) {
    ["header"]=>
    bool(true)
    ["flags"]=>
    array(3) {
      ["unsynch"]=>
      bool(false)
      ["exthead"]=>
      bool(false)
      ["experim"]=>
      bool(false)
    }
    ["majorversion"]=>
    int(3)
    ["minorversion"]=>
    int(0)
    ["headerlength"]=>
    int(4096)
    ["tag_offset_start"]=>
    int(0)
    ["tag_offset_end"]=>
    int(4096)
    ["encoding"]=>
    string(5) "UTF-8"
    ["comments"]=>
    array(5) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
      ["genre"]=>
      array(1) {
        [0]=>
        string(5) "Dance"
      }
    }
    ["TIT2"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TIT2"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(7) "My Song"
        ["datalength"]=>
        int(8)
        ["dataoffset"]=>
        int(10)
        ["framenamelong"]=>
        string(34) "Title/songname/content description"
        ["framenameshort"]=>
        string(5) "title"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["TPE1"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TPE1"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(10) "The Artist"
        ["datalength"]=>
        int(11)
        ["dataoffset"]=>
        int(28)
        ["framenamelong"]=>
        string(28) "Lead performer(s)/Soloist(s)"
        ["framenameshort"]=>
        string(6) "artist"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["TALB"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TALB"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(13) "Greatest Hits"
        ["datalength"]=>
        int(14)
        ["dataoffset"]=>
        int(49)
        ["framenamelong"]=>
        string(22) "Album/Movie/Show title"
        ["framenameshort"]=>
        string(5) "album"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["TYER"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TYER"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(4) "2004"
        ["datalength"]=>
        int(5)
        ["dataoffset"]=>
        int(73)
        ["framenamelong"]=>
        string(4) "Year"
        ["framenameshort"]=>
        string(4) "year"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["TCON"]=>
    array(1) {
      [0]=>
      array(10) {
        ["frame_name"]=>
        string(4) "TCON"
        ["frame_flags_raw"]=>
        int(0)
        ["data"]=>
        string(1) "3"
        ["datalength"]=>
        int(2)
        ["dataoffset"]=>
        int(88)
        ["framenamelong"]=>
        string(12) "Content type"
        ["framenameshort"]=>
        string(5) "genre"
        ["flags"]=>
        array(6) {
          ["TagAlterPreservation"]=>
          bool(false)
          ["FileAlterPreservation"]=>
          bool(false)
          ["ReadOnly"]=>
          bool(false)
          ["compression"]=>
          bool(false)
          ["Encryption"]=>
          bool(false)
          ["GroupingIdentity"]=>
          bool(false)
        }
        ["encodingid"]=>
        int(0)
        ["encoding"]=>
        string(10) "ISO-8859-1"
      }
    }
    ["padding"]=>
    array(3) {
      ["start"]=>
      int(100)
      ["length"]=>
      int(3996)
      ["valid"]=>
      bool(true)
    }
  }
  ["id3v1"]=>
  array(10) {
    ["title"]=>
    string(7) "My Song"
    ["artist"]=>
    string(10) "The Artist"
    ["album"]=>
    string(13) "Greatest Hits"
    ["year"]=>
    string(4) "2004"
    ["comment"]=>
    string(0) ""
    ["comments"]=>
    array(5) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
      ["comment"]=>
      array(1) {
        [0]=>
        string(0) ""
      }
    }
    ["padding_valid"]=>
    bool(true)
    ["tag_offset_end"]=>
    int(262521)
    ["tag_offset_start"]=>
    int(262393)
    ["encoding"]=>
    string(10) "ISO-8859-1"
  }
  ["mime_type"]=>
  string(10) "audio/mpeg"
  ["mpeg"]=>
  array(1) {
    ["audio"]=>
    array(23) {
      ["raw"]=>
      array(13) {
        ["synch"]=>
        int(4094)
        ["version"]=>
        int(3)
        ["layer"]=>
        int(1)
        ["protection"]=>
        int(1)
        ["bitrate"]=>
        int(9)
        ["sample_rate"]=>
        int(0)
        ["padding"]=>
        int(0)
        ["private"]=>
        int(0)
        ["channelmode"]=>
        int(0)
        ["modeextension"]=>
        int(0)
        ["copyright"]=>
        int(0)
        ["original"]=>
        int(1)
        ["emphasis"]=>
        int(0)
      }
      ["version"]=>
      string(1) "1"
      ["layer"]=>
      int(3)
      ["channelmode"]=>
      string(6) "stereo"
      ["channels"]=>
      int(2)
      ["sample_rate"]=>
      int(44100)
      ["protection"]=>
      bool(false)
      ["private"]=>
      bool(false)
      ["modeextension"]=>
      string(0) ""
      ["copyright"]=>
      bool(false)
      ["original"]=>
      bool(true)
      ["emphasis"]=>
      string(4) "none"
      ["padding"]=>
      bool(false)
      ["bitrate"]=>
      int(128000)
      ["framelength"]=>
      float(418)
      ["bitrate_mode"]=>
      string(3) "cbr"
      ["VBR_method"]=>
      string(4) "Xing"
      ["xing_flags_raw"]=>
      int(15)
      ["xing_flags"]=>
      array(4) {
        ["frames"]=>
        bool(true)
        ["bytes"]=>
        bool(true)
        ["toc"]=>
        bool(true)
        ["vbr_scale"]=>
        bool(true)
      }
      ["VBR_frames"]=>
      int(617)
      ["VBR_bytes"]=>
      int(258297)
      ["toc"]=>
      array(100) {
        [0]=>
        int(0)
        [1]=>
        int(3)
        [2]=>
        int(5)
        [3]=>
        int(8)
        [4]=>
        int(10)
        [5]=>
        int(13)
        [6]=>
        int(15)
        [7]=>
        int(18)
        [8]=>
        int(20)
        [9]=>
        int(23)
        [10]=>
        int(25)
        [11]=>
        int(28)
        [12]=>
        int(30)
        [13]=>
        int(34)
        [14]=>
        int(36)
        [15]=>
        int(39)
        [16]=>
        int(41)
        [17]=>
        int(43)
        [18]=>
        int(46)
        [19]=>
        int(48)
        [20]=>
        int(51)
        [21]=>
        int(53)
        [22]=>
        int(56)
        [23]=>
        int(58)
        [24]=>
        int(61)
        [25]=>
        int(64)
        [26]=>
        int(67)
        [27]=>
        int(69)
        [28]=>
        int(72)
        [29]=>
        int(74)
        [30]=>
        int(77)
        [31]=>
        int(79)
        [32]=>
        int(82)
        [33]=>
        int(84)
        [34]=>
        int(87)
        [35]=>
        int(89)
        [36]=>
        int(92)
        [37]=>
        int(94)
        [38]=>
        int(97)
        [39]=>
        int(100)
        [40]=>
        int(102)
        [41]=>
        int(105)
        [42]=>
        int(107)
        [43]=>
        int(110)
        [44]=>
        int(112)
        [45]=>
        int(115)
        [46]=>
        int(117)
        [47]=>
        int(120)
        [48]=>
        int(122)
        [49]=>
        int(125)
        [50]=>
        int(128)
        [51]=>
        int(131)
        [52]=>
        int(133)
        [53]=>
        int(136)
        [54]=>
        int(138)
        [55]=>
        int(141)
        [56]=>
        int(143)
        [57]=>
        int(146)
        [58]=>
        int(148)
        [59]=>
        int(151)
        [60]=>
        int(153)
        [61]=>
        int(156)
        [62]=>
        int(158)
        [63]=>
        int(161)
        [64]=>
        int(164)
        [65]=>
        int(166)
        [66]=>
        int(169)
        [67]=>
        int(171)
        [68]=>
        int(174)
        [69]=>
        int(176)
        [70]=>
        int(179)
        [71]=>
        int(181)
        [72]=>
        int(184)
        [73]=>
        int(186)
        [74]=>
        int(189)
        [75]=>
        int(192)
        [76]=>
        int(195)
        [77]=>
        int(197)
        [78]=>
        int(199)
        [79]=>
        int(202)
        [80]=>
        int(204)
        [81]=>
        int(207)
        [82]=>
        int(209)
        [83]=>
        int(212)
        [84]=>
        int(214)
        [85]=>
        int(217)
        [86]=>
        int(219)
        [87]=>
        int(222)
        [88]=>
        int(225)
        [89]=>
        int(228)
        [90]=>
        int(230)
        [91]=>
        int(233)
        [92]=>
        int(235)
        [93]=>
        int(238)
        [94]=>
        int(240)
        [95]=>
        int(243)
        [96]=>
        int(245)
        [97]=>
        int(248)
        [98]=>
        int(250)
        [99]=>
        int(253)
      }
      ["LAME"]=>
      array(24) {
        ["short_version"]=>
        string(9) "LAME3.100"
        ["numeric_version"]=>
        string(5) "3.100"
        ["integer_version"]=>
        array(2) {
          [0]=>
          int(3)
          [1]=>
          int(100)
        }
        ["raw"]=>
        array(10) {
          ["vbr_method"]=>
          int(1)
          ["RGAD_track"]=>
          int(0)
          ["RGAD_album"]=>
          int(0)
          ["abrbitrate_minbitrate"]=>
          int(128)
          ["noise_shaping"]=>
          int(2)
          ["stereo_mode"]=>
          int(1)
          ["not_optimal_quality"]=>
          int(0)
          ["source_sample_freq"]=>
          int(1)
          ["mp3_gain"]=>
          int(0)
          ["surround_info"]=>
          int(0)
        }
        ["vbr_quality"]=>
        int(57)
        ["tag_revision"]=>
        int(0)
        ["vbr_method"]=>
        string(3) "cbr"
        ["lowpass_frequency"]=>
        int(17000)
        ["encoding_flags"]=>
        array(4) {
          ["nspsytune"]=>
          bool(true)
          ["nssafejoint"]=>
          bool(false)
          ["nogap_next"]=>
          bool(false)
          ["nogap_prev"]=>
          bool(false)
        }
        ["ath_type"]=>
        int(4)
        ["encoder_delay"]=>
        int(576)
        ["end_padding"]=>
        int(1600)
        ["noise_shaping"]=>
        int(2)
        ["stereo_mode"]=>
        string(6) "stereo"
        ["not_optimal_quality"]=>
        bool(false)
        ["source_sample_freq"]=>
        string(8) "44.1 kHz"
        ["mp3_gain_db"]=>
        float(0)
        ["mp3_gain_factor"]=>
        float(1)
        ["surround_info"]=>
        string(16) "no surround info"
        ["preset_used_id"]=>
        int(128)
        ["preset_used"]=>
        string(20) "--alt-preset cbr 128"
        ["audio_bytes"]=>
        int(258297)
        ["music_crc"]=>
        int(14435)
        ["lame_tag_crc"]=>
        int(57321)
      }
    }
  }
  ["playtime_seconds"]=>
  float(16.1174375)
  ["tags_html"]=>
  array(2) {
    ["id3v1"]=>
    array(4) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
    }
    ["id3v2"]=>
    array(5) {
      ["title"]=>
      array(1) {
        [0]=>
        string(7) "My Song"
      }
      ["artist"]=>
      array(1) {
        [0]=>
        string(10) "The Artist"
      }
      ["album"]=>
      array(1) {
        [0]=>
        string(13) "Greatest Hits"
      }
      ["year"]=>
      array(1) {
        [0]=>
        string(4) "2004"
      }
      ["genre"]=>
      array(1) {
        [0]=>
        string(5) "Dance"
      }
    }
  }
  ["bitrate"]=>
  int(128000)
  ["playtime_string"]=>
  string(4) "0:16"
}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.