Hi and thank you for your help :)
>> I think you are missing to handle more then one channel
That is what i do with modulo ( i2 % 'channelcount' ) wich allways
returns the remainder of i2/channelcount
>> and your add function is totally borked as data_size is most likely
in bytes and you iterate over a buffer pointer that is int16. So most
likely you are over reading the buffer.
right in two ways ;) the add function's parameter was only char, so it
was unable to store a large number, and i was overreading the buffer.
With that fixes my programm runs fine now ( It shows a single peak where
it is expected to show it ).
Again, thank you for helping me
Marco
Am 03.03.2010 14:57, schrieb Benjamin Larsson:
Marco wrote:
Hi
I am programming a toolset for analysing wav-files with FFT. The
programm works fine, except that the results are crap. I made some
testfiles (4khz and 440Hz) but in the end i see just crap (it does
not show me a peak 440Hz). I believe that my decoding and splitting
is wrong, so i'd like you to tell me whether it is right.
I want to do 2 FT-analyzes per channel (fftlyzer[analyze][channel]).
fftlyzer is a class I made for analyzing the sound. (It is doing the
FT-analyse when it's internal buffer is full, stores the result and
resets the buffer afterwards.)
Here is a snippet of my code.
I think you are missing to handle more then one channel and your add
function is totally borked as data_size is most likely in bytes and
you iterate over a buffer pointer that is int16. So most likely you
are over reading the buffer. My advice is that you first make sure
that the data you get is ok, that by writing the raw buffer to disc
and then play it with some nice program that can handle raw audio.
(ffmpeg, sox, audacity).
MvH
Benjamin Larsson
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user