Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
how to get frequency per second in file mp3 in C#
Posted 8-Dec-12 16:14pm
Comments
Krunal Rohit at 8-Dec-12 22:58pm
   
What is your scenario ? Elaborate your question...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Though your problem is not clear, I can only help you with this :
http://stackoverflow.com/questions/10833529/get-frequency-and-amplitude-from-wave-file[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You need to find Mpeg Header (it may goes after little offset from file beginning and after ID3V2 Tag in mp3 file)
After you should read the header - 4 bytes Header[4]
byte _version = (byte)((Header[1] & 0x18) >> 3); // Mpeg Version
byte _layer = (byte)((Header[1] & 0x06) >> 1); // Mpeg Layer
byte _freqIndex = (byte)((Header[2] & 0x0C) >> 2); // Frequency Index
You got Frequency index _freqIndex and Mpeg Version _version which you can use according next table to get rate in Hz.
Sampling rate frequency index (values are in Hz)
bits MPEG1 MPEG2 MPEG2.5
00 44100 22050 11025
01 48000 24000 12000
10 32000 16000 8000
11 reserv. reserv. reserv.
For more information see information abt Mpeg3 header format next articles will helps you:
MPEG Audio Frame Header[^]
http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html[^]
 
Regards,
Maxim.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 746
1 OriginalGriff 345
2 Magic Wonder 131
3 Kishore Pogaru 130
4 Fredrik Bornander 130
0 OriginalGriff 5,705
1 Sergey Alexandrovich Kryukov 4,763
2 CPallini 4,570
3 George Jonsson 3,142
4 Gihan Liyanage 2,450


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 10 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100