PHP code example of nicoverbruggen / mediaprobe
1. Go to this page and download the library: Download nicoverbruggen/mediaprobe library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nicoverbruggen / mediaprobe example snippets
use NicoVerbruggen\MediaProbe\MediaProbe;
$path = "./path/to/my/file.mp3";
$probe = new MediaProbe($path);
$tags = $probe->getMediaInfo()->format->tags;
return [
'artist' => $tags->artist,
'album' => $tags->album,
'title' => $tags->title,
];
use NicoVerbruggen\MediaProbe\MediaProbe;
$path = "./path/to/my/file.mp3";
$probe = new MediaProbe($path);
$destination = "./path/to/cover.jpg";
$probe->extractCover($destination);