Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading Audio Channel Data From A Playing Sound File 1

Status
Not open for further replies.

apc2004

Programmer
Aug 23, 2005
38
0
0
GB
Hi,

I am currently building an MP3 / Audio Player control for WinForms .net v1.1 using Managed DirectX 9c.

I can't find any decent tutorial(s) or example project(s) on how to make a Spectrum Analyser that moves to the music or sound that is currently playing.

I have a few very rough ideas... somehow I need to read the audio data (per channel) of the currently loaded (playing) file, the problem is I have absolutely no idea how to do this.

Can anyone offer some advice, code samples, or anything that can point me in the right direction?

Thanks in advance...
 


These two are written in C++. The first one gives you a good look at the makings of a wav file and the second one contains C++ code on how to read the levels.

Basically, I believe you need to decode your MP3 back into a raw wav format and calculate the DB level for each audio chunk (sample) as it plays. Remember that if you have 2 channels (Left and Right) then your samples become doubled so you have to read the DB output for the entire sound frame.

Sounds scary but reading the docs will help.
 
C++ eek... haven't touched that for a long time, I feel a brush up comin' on!

Thanks for the links, at first glance they look pretty good, will haves a proper read tomorrow. [smile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top