PHP code example of codememory / wave-fork
1. Go to this page and download the library: Download codememory/wave-fork 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/ */
codememory / wave-fork example snippets
use BoyHagemann\Wave\Wave;
$wave = new Wave();
$wave->setFilename('path/to/your/file.wav');
$metadata = $wave->analyze()->getMetadata();
$metadata->getName();
$metadata->getSize();
$metadata->getFormat();
$metadata->getChannels();
$metadata->getSampleRate();
$metadata->getBytesPerSecond();
$metadata->getBlockSize();
$metadata->getBitsPerSample();
$metadata->getExtensionSize();
$metadata->getExtensionData();
// Assuming we already analyzed the wave...
$data = $wave->getWaveformData();
// Get the amplitude values for each channel
foreach($data->getChannels() as $channel) {
$amplitudes[] = $channel->getValues();
}
$wave->setSteps(10000);