-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.php
27 lines (22 loc) · 1.26 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
require "class.bpm.php";
echo "detecting bpm for the file test.mp3 with no predefined length using ffmpeg:\n";
$bpm_detect = new bpm_detect("test.mp3",DETECT_LENGTH,USE_FFMPEG);
echo "track length is ".$bpm_detect->getLength()." sec\n";
echo "average track bpm is ".$bpm_detect->detectBPM()."\n";
echo "track bpm by 16 seconds is ".json_encode($bpm_detect->detectBPM(SPLIT),JSON_NUMERIC_CHECK)."\n";
echo "track bpm by 4 seconds is ".json_encode($bpm_detect->detectBPM(SPLIT,4),JSON_NUMERIC_CHECK)."\n";
echo "total processing time is ".$bpm_detect->getProcessingTime()." sec \n";
//echo "used commands: ";
//var_dump($bpm_detect->getCmdLog());
echo "\n";
echo "detecting bpm for the file test.mp3 with no predefined length using sox and mpg123:\n";
$bpm_detect = new bpm_detect("test.mp3",DETECT_LENGTH,USE_SOX);
echo "track length is ".$bpm_detect->getLength()." sec\n";
echo "average track bpm is ".$bpm_detect->detectBPM()."\n";
echo "track bpm by 16 seconds is ".json_encode($bpm_detect->detectBPM(SPLIT),JSON_NUMERIC_CHECK)."\n";
echo "track bpm by 4 seconds is ".json_encode($bpm_detect->detectBPM(SPLIT,4),JSON_NUMERIC_CHECK)."\n";
echo "total processing time is ".$bpm_detect->getProcessingTime()." sec \n";
//echo "used commands: ";
//var_dump($bpm_detect->getCmdLog());
?>