getid3_aa

The rtMedia for WordPress, BuddyPress and bbPress getid3 aa class.

Defined (1)

The class is defined in the following location(s).

/lib/getid3/module.audio.aa.php  
  1. class getid3_aa extends getid3_handler 
  2.  
  3. public function Analyze() { 
  4. $info = &$this->getid3->info; 
  5.  
  6. $this->fseek($info['avdataoffset']); 
  7. $AAheader = $this->fread(8); 
  8.  
  9. $magic = "\x57\x90\x75\x36"; 
  10. if (substr($AAheader, 4, 4) != $magic) { 
  11. $info['error'][] = 'Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($AAheader, 4, 4)).'"'; 
  12. return false; 
  13.  
  14. // shortcut 
  15. $info['aa'] = array(); 
  16. $thisfile_aa = &$info['aa']; 
  17.  
  18. $info['fileformat'] = 'aa'; 
  19. $info['audio']['dataformat'] = 'aa'; 
  20. $info['error'][] = 'Audible Audiobook (.aa) parsing not enabled in this version of getID3() ['.$this->getid3->version().']'; 
  21. return false; 
  22. $info['audio']['bitrate_mode'] = 'cbr'; // is it? 
  23. $thisfile_aa['encoding'] = 'ISO-8859-1'; 
  24.  
  25. $thisfile_aa['filesize'] = getid3_lib::BigEndian2Int(substr($AUheader, 0, 4)); 
  26. if ($thisfile_aa['filesize'] > ($info['avdataend'] - $info['avdataoffset'])) { 
  27. $info['warning'][] = 'Possible truncated file - expecting "'.$thisfile_aa['filesize'].'" bytes of data, only found '.($info['avdataend'] - $info['avdataoffset']).' bytes"'; 
  28.  
  29. $info['audio']['bits_per_sample'] = 16; // is it? 
  30. $info['audio']['sample_rate'] = $thisfile_aa['sample_rate']; 
  31. $info['audio']['channels'] = $thisfile_aa['channels']; 
  32.  
  33. //$info['playtime_seconds'] = 0; 
  34. //$info['audio']['bitrate'] = 0; 
  35.  
  36. return true; 
  37.