public function create($content)
{
$pathname = $this->getTempPathname();
$fp = fopen($pathname, 'wb');
fwrite($fp, $content);
fclose($fp);
return new TempFile($pathname);
}
/** * Extract file meta data * * @param Audio $audio audio file instance * @return array */ protected function extractInformation(Audio $audio) { $tmpFile = $this->temp->create($audio->getContent()); $info = $this->reader->analyze($tmpFile->getPathname()); $tmpFile->destroy(); if (isset($info['audio']['streams'])) { unset($info['audio']['streams']); } return [$info['audio'], $info['playtime_seconds'], $info['bitrate']]; }