How to generate waveform from audio file?
Waveform images done the easy way

<?php
$url = 'http://my_server.com/song.mp3'; //you can also send m4a, flac, wav and wma
$data = json_decode(file_get_contents('http://api.rest7.com/v1/sound_waveform.php?url=' . $url));
if (@$data->success !== 1)
{
echo('Failed');
}
else
{
$image = file_get_contents($data->file);
file_put_contents('waveform.png', $image);
}
The script will generate for a 4 minute song something similar to this image:

Comments