How to determine mp3 frequency in .NET?

I want to create a very simple piece of software in C # .NET in order to transfer the path to a folder and detect all files with a frequency below a given threshold. Any pointers on how I will do this?

+3
source share
3 answers

You must read mp3 files. To do this, you need to find the specifications for them.

Usually an mp3 file is wrapped in an ID3 tag, so you need to read it, find its length and skip it. Take ID3v2.3 for example:

ID3v2/file identifier   "ID3" 
ID3v2 version           $03 00
ID3v2 flags             %abc00000
ID3v2 size              4 * %0xxxxxxx

so bytes 6,7,8,9 store the length of the header in big-endian form. Here is an example of some file:

 0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
49 44 33 03 00 00 00 00 07 76 54 43 4f 4e 00 00

07 76 - . , 3F6. 10 (A), = 400. mp3-.

mp3 header:

: AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM, FF, t :

bits    MPEG1   MPEG2   MPEG2.5
00  44100   22050   11025
01  48000   24000   12000
10  32000   16000   8000
11  reserv. reserv. reserv.
+4

UltraID3Lib mp3 (, )

+2

Check the meaning of the frequency bits in the file. There is information about the mp3 format .

+1
source

Source: https://habr.com/ru/post/1767320/


All Articles