/** * Read metadata * * @throws \RuntimeException * * @return array */ public function read() { $this->handler->Analyze(); if (!empty($this->info['error'])) { GetId3::getInstance()->close(); throw new \RuntimeException(sprintf('Error while reading metadata from "%s": %s.', $this->filename, implode(PHP_EOL, $this->info['error']))); } if (isset($this->info[$this->name])) { $data = $this->info[$this->name]; if (in_array($this->name, array('audio', 'video'))) { $data['playtime'] = $this->info['playtime_seconds']; } return $data; } return array(); }