コード例 #1
0
ファイル: Flac.php プロジェクト: Tjorriemorrie/app
 /**
  * @access  private
  */
 function __construct($streamSerial, $streamData, $filePointer)
 {
     parent::__construct($streamSerial, $streamData, $filePointer);
     $this->_decodeHeader();
     $this->_decodeCommentsHeader();
     $this->_streamLength = $this->_streamInfo['total_samples'] / $this->_streamInfo['sample_rate'];
 }
コード例 #2
0
 /**
  * @access  private
  */
 function __construct($streamSerial, $streamData, $filePointer)
 {
     parent::__construct($streamSerial, $streamData, $filePointer);
     $this->_decodeHeader();
     $this->_decodeCommentsHeader();
     $endSec = (('0x' . substr($this->_lastGranulePos, 0, 8)) * pow(2, 32) + ('0x' . substr($this->_lastGranulePos, 8, 8))) / $this->_header['rate'];
     $startSec = (('0x' . substr($this->_firstGranulePos, 0, 8)) * pow(2, 32) + ('0x' . substr($this->_firstGranulePos, 8, 8))) / $this->_header['rate'];
     //make sure the offset is worth taking into account oggz_chop related hack
     if ($startSec > 1) {
         $this->_streamLength = $endSec - $startSec;
         $this->_startOffset = $startSec;
     } else {
         $this->_streamLength = $endSec;
     }
 }
コード例 #3
0
ファイル: Theora.php プロジェクト: Tjorriemorrie/app
 /**
  * @access  private
  */
 function __construct($streamSerial, $streamData, $filePointer)
 {
     parent::__construct($streamSerial, $streamData, $filePointer);
     $this->_decodeIdentificationHeader();
     $this->_decodeCommentsHeader();
     $endSec = $this->getSecondsFromGranulePos($this->_lastGranulePos);
     $startSec = $this->getSecondsFromGranulePos($this->_firstGranulePos);
     //make sure the offset is worth taking into account oggz_chop related hack
     if ($startSec > 1) {
         $this->_streamLength = $endSec - $startSec;
         $this->_startOffset = $startSec;
     } else {
         $this->_streamLength = $endSec;
     }
     $this->_avgBitrate = $this->_streamLength ? $this->_streamSize * 8 / $this->_streamLength : 0;
 }