22 $info = &$this->getid3->info;
25 $AMRheader = $this->
fread(6);
27 $magic =
'#!AMR'.
"\x0A";
28 if (substr($AMRheader, 0, 6) != $magic) {
34 $info[
'amr'] = array();
35 $thisfile_amr = &
$info[
'amr'];
37 $info[
'fileformat'] =
'amr';
38 $info[
'audio'][
'dataformat'] =
'amr';
39 $info[
'audio'][
'bitrate_mode'] =
'vbr';
40 $info[
'audio'][
'bits_per_sample'] = 13;
41 $info[
'audio'][
'sample_rate'] = 8000;
42 $info[
'audio'][
'channels'] = 1;
43 $thisfile_amr[
'frame_mode_count'] = array(0=>0, 1=>0, 2=>0, 3=>0, 4=>0, 5=>0, 6=>0, 7=>0);
47 if ((strlen($buffer) < $this->getid3->fread_buffer_size()) && !
feof($this->getid3->fp)) {
48 $buffer .= $this->
fread($this->getid3->fread_buffer_size() * 2);
50 $AMR_frame_header = ord(substr($buffer, 0, 1));
51 $codec_mode_request = ($AMR_frame_header & 0x78) >> 3;
52 if ($codec_mode_request > 7) {
55 $thisfile_amr[
'frame_mode_count'][$codec_mode_request]++;
57 }
while (strlen($buffer) > 0);
59 $info[
'playtime_seconds'] = array_sum($thisfile_amr[
'frame_mode_count']) * 0.020;
60 $info[
'audio'][
'bitrate'] = (8 * (
$info[
'avdataend'] -
$info[
'avdataoffset'])) /
$info[
'playtime_seconds'];
68 static $amr_mode_bitrate = array(
78 return (isset($amr_mode_bitrate[
$key]) ? $amr_mode_bitrate[$key] :
false);
82 static $amr_mode_bitrate = array(
92 return (isset($amr_mode_bitrate[
$key]) ? $amr_mode_bitrate[$key] :
false);
getID3() by James Heinrich info@getid3.org //
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
amr_mode_bytes_per_frame($key)
fseek($bytes, $whence=SEEK_SET)