Exemplo n.º 1
0
 /**
  * Constructs the class with given parameters.
  *
  * @param Zend_Io_Reader $reader The reader object.
  */
 public function __construct($reader)
 {
     parent::__construct($reader);
     $this->_vorbisVersion = $this->_reader->readUInt32LE();
     $this->_audioChannels = $this->_reader->readUInt8();
     $this->_audioSampleRate = $this->_reader->readUInt32LE();
     $this->_bitrateMaximum = $this->_reader->readInt32LE();
     $this->_bitrateNominal = $this->_reader->readInt32LE();
     $this->_bitrateMinimum = $this->_reader->readInt32LE();
     $this->_blocksize0 = pow(2, ($tmp = $this->_reader->readUInt8()) & 0xf);
     $this->_blocksize1 = pow(2, $tmp >> 4 & 0xf);
     $framingFlag = $this->_reader->readUInt8() & 0x1;
     if ($this->_blocksize0 > $this->_blocksize1 || $framingFlag == 0) {
         throw new Zend_Media_Vorbis_Exception('Undecodable Vorbis stream');
     }
 }
Exemplo n.º 2
0
 /**
  * Constructs the class with given parameters.
  *
  * @param Zend_Io_Reader $reader The reader object.
  */
 public function __construct($reader)
 {
     parent::__construct($reader);
     $this->_reader->skip($this->_packetSize - 7);
 }
Exemplo n.º 3
0
 /**
  * Magic function so that $obj->value will work. The method will attempt to return the first field by the given
  * name from the comment. If there is no field with given name, functionality of the parent method is executed.
  *
  * @param string $name The field name.
  * @return mixed
  */
 public function __get($name)
 {
     if (method_exists($this, 'get' . ucfirst($name))) {
         return call_user_func(array($this, 'get' . ucfirst($name)));
     }
     if (!empty($this->_comments[strtoupper($name)])) {
         return $this->_comments[strtoupper($name)][0];
     }
     parent::__get($name);
 }