当前位置:网站首页>PHP to get information such as audio duration

PHP to get information such as audio duration

2022-07-08 01:38:00 Xiao ASI

Make a note of Resources found by Baidu

1、 First , We need to download one first PHP class —getid3
https://codeload.github.com/JamesHeinrich/getID3/zip/master

2、 Unzip into project , And reference

<?php

    private function gettimes($url){
    
     
            include_once root_path('extend/getid3/getid3').'getid3.php';
           
            $getID3 = new \getID3();
            $ThisFileInfo = @$getID3->analyze($url); 
            // Analyze documents ,$url Is the address of the audio file ( File absolute path )
            $fileduration= $ThisFileInfo['playtime_seconds']; 
            return  $fileduration;
    }



Resource link :https://download.csdn.net/download/weixin_46044420/85860235

原网站

版权声明
本文为[Xiao ASI]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/189/202207072339530314.html