PHP code example of masterfermin02 / audio

1. Go to this page and download the library: Download masterfermin02/audio 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/ */

    

masterfermin02 / audio example snippets


use Masterfermin02\Audio\Audio;

$audio = Audio::create();

$audio->loadFile(getenv('filename'));
$audio->printSampleInfo();

if ($audio->waveId == "RIFF")
{
    $imageSrc = $audio->getVisualization();
    print "<img src='$imageSrc' />";
}

use Masterfermin02\Audio\Audio;

$audio = Audio::create();

$audio->loadFile(getenv('filename'));
$audio->printSampleInfo();

if ($audio->waveId == "RIFF")
{
    $imageSrc = $audio->setImageBaseDir('./images/')
    ->getVisualization($filename);
    print "<img src='$imageSrc' />";
}