Php obtains the playback time of the music file. The article briefly introduces the php music file playback time code. if you need it, you can take a closer look. Mp3, wav, or other formats supported by mediaplayer. the code is as follows: copy the article to briefly introduce the php music file playback time code. if you need it, take a closer look. // Formats supported by mp3, wav, or other media players.
The code is as follows: |
|
$ File = "C:/Users/Public/Music/Sample Music/kalimbaloud "; If (! File_exists ($ file )){ Exit ('media file does not exist .'); } // Create a Windows Media Player interface $ Player = new COM ("WMPlayer. OCX "); $ Media = $ player-> newMedia ($ file ); // Obtain the song time (unit: Seconds) Echo $ media-> duration. 'second ';
|
Bytes. // Formats supported by mp3, wav, or other media player. the code is copied as follows...