Home> php教程> php手册> body text

php 获取音频文件时长

WBOY
Release: 2016-06-06 19:35:21
Original
2885 people have browsed it

getID3()是从MP3等媒体文件中提取文件信息的php类,既可以提取也能修改文件的标签信息。它能读取的文件类型非常多,例如MP3、wav等.示例官方下载地址:http://sourceforge.net/projects/getid3/files/ 无 ?phpinclude "getid3/getid3.php";$fileUrl = "11471.m

getID3() 是从MP3等媒体文件中提取文件信息的php类,既可以提取也能修改文件的标签信息。它能读取的文件类型非常多,例如MP3、wav等. 示例官方下载地址:http://sourceforge.net/projects/getid3/files/
analyze("11471.mp3"); //分析文件 $time = $ThisFileInfo['playtime_seconds']; //获取mp3的长度信息 echo $ThisFileInfo['playtime_seconds']; //获取MP3文件时长 ?>
Copy after login
/*使用这个不是很精确。*/ function get_duration($file,$rate=128){ if(!$file)return ; return ceil(((filesize($file)/1024)/$rate)*8); }
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!