Created
February 1, 2022 16:12
-
-
Save tommycutter/3f91117277812d87979c999c49b830a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fileName = time().'.mp3'; | |
$fileUrl = $_GET['fileUrl']; | |
$jsonOutputFile = time().'-normalized.json'; | |
file_put_contents($fileName, file_get_contents($fileUrl)); | |
exec('audiowaveform -i '.$fileName.' -o '.$jsonOutputFile.' --pixels-per-second 20 --bits 8'); | |
sleep(5); | |
echo file_get_contents($jsonOutputFile); | |
unlink($fileName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment