How PHP Gets the audio file length

Source: Internet
Author: User
This article mainly introduces the method of PHP to get audio file length, by introducing third party GETID3 class to realize the function of operation audio file, the friend who need can refer to

Problem:

Yesterday in the new forum function, the mobile display of audio files need to know how long audio;

The specific solutions are as follows:

The first is the database to increase the length of the field to save the audio file;

And then I found getID3 on the Internet. This class can get the length of the audio file and bring it into the project;

Second, in the mobile side of the interface to upload audio files, call this class, the following is the specific wording:

$getID 3 = new getID3 ();  Instantiate class $thisfileinfo = $getID 3->analyze ($path); Parse the file, $path the address of the audio file $fileduration= $ThisFileInfo [' playtime_seconds ']; This gets the length of the audio file.

and the corresponding data is stored in the database;

Then, when the data list is needed on the mobile side, the audio duration is returned to the past.

The above is the whole content of this article, I hope that everyone's study has helped.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.