0
0

I know this should probably not be on this forum but I know nowhere else to go.

I just wanted to ask if there is any way of detecting if a file is an mp3, apart from checking the file extension. Is there some kind of header which identifies it as an mp3?

  • You must to post comments
0
0

You can open the file and read the first few hundred bytes. An MPEG is comprised of regularly repeating sync headers. Each header specifies the particulars of the MPEG (e.g., MPEG version, layer, bitrate, etc.).

You’ll know you have an MP3 if you can verify a few consecutive sync frames, and if the layer bits indicate Layer III.

There’s a lot of information on the net that will show you how to parse an MPEG.

  • SD
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.