From: Rob v.K <crucificator_de@ho...> - 2006-11-30 11:00:40
I am trying to work a bit with audacity, see what I can learn but something
is not clear to me when looking at the code. I just want to try to get an
average frequency and amplitude for the file but in different effects I see
different ways of working with the track. I've tried to use the get method
but somehow my buffer is full of zeros. Here the code, someone with
experience who sees the mistake I made?
WaveTrack * t = m_pEffect->GetTrack();
const int size = 8192;
startTime = t->GetStartTime();
longSampleCount start = t->TimeToLongSamples(startTime);
t->Get((samplePtr) buffer, floatSample, start, len); // len is an integer
sampleCount j = 0;
float total = 0.0;
total += buffer[j]
total is always 0. So I'm guessing my get doesn't work as it is supposed to?
I've tried with multiple files and sizes.
Be the first to hear what's new at MSN - sign up to our free newsletters!