time length of an mp3 file

前端 未结 6 2157
别那么骄傲
别那么骄傲 2020-12-01 07:11

What is the simplest way to determine the length (in seconds) of a given mp3 file, without using outside libraries? (python source highly appreciated)

6条回答
  •  孤街浪徒
    2020-12-01 07:25

    For google followers' sake, here are a few more external libs:

    mpg321 -t

    ffmpeg -i

    midentify (mplayer basically) see Using mplayer to determine length of audio/video file

    mencoder (pass it invalid params, it will spit out an error message but also give you info on the file in question, ex $ mencoder inputfile.mp3 -o fake)

    mediainfo program http://mediainfo.sourceforge.net/en

    exiftool

    the linux "file" command

    mp3info

    sox

    refs: https://superuser.com/questions/36871/linux-command-line-utility-to-determine-mp3-bitrate

    http://www.ruby-forum.com/topic/139468

    mp3 length in milliseconds

    (making this a wiki for others to add to).

    and libs: .net: naudio, java: jlayer, c: libmad

    Cheers!

提交回复
热议问题