I run the sample dsppluginviewer from SDK. It shows the spectrum data in graphics. And I play the same song with Widnow’s Media Player with skin from ‘bars and waves->bars’. I compared these tow graphics and I notice that they are quite different.
My common sence told me that the lower frequency, ie from 0hz – 100 hz should be almost nothing. And it is true in Microsoft Media Player’s. But it is almost always the strongest one in yours.
Do I need to use some other algorithm to translate the raw data from getSpectrum to simulate the same outfit of Microsoft’s?
- tomfang2000 asked 10 years ago
I did not change anything on the dsppluginviewer project. So it will show the spectrum in db format. Thus the first vertical line stands for the sound frequency around 0hz – 43hz ((44100 / 2) / 512). This line is always almost the strongest line on the whole graph. But the sound inside the range of frequency should week, at least it should no be almost always the strongest, right?
So I guess if the data returned from getSpectrum is correct, the the algorithm translate from raw data to spectrum data is not correct.
Compared to Microsoft Media Player’s spectrum output, the graph output of the spectrum on dsppluginviewer sample looks incorrect.
Any further suggestion on this?
[quote="tomfang2000":2hxceedc]Here is the images for the spectrum output:
http://pg.photos.yahoo.com/ph/fang_yi20 … m=ce90.jpg
http://pg.photos.yahoo.com/ph/fang_yi20 … m=ac39.jpg[/quote:2hxceedc]
I solved this issue with a scale table: create a table of scale values that correspond to each entry (e.g. 256, 512, etc., ). Multiply the frequency value by the value in the corresponding scale table. You can remap it however you llike. I listened to various tracks of music and tuned the table until it looked good for all the tracks. The only issue I noticed with getSpectrum() was the highest frequency component entry (last entry) appeared to be maxed out, all the time (I don’t process the entire spectrum, so was not an issue).
Additionally, I would not use media player as a reference for accuracy; use a professional tool instead (SF, Audition, etc.).
- John Schultz answered 10 years ago
Please login first to submit.