MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / calcFFT

Method calcFFT

extlibs/soloud/src/core/soloud_bus.cpp:263–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261 }
262
263 float * Bus::calcFFT()
264 {
265 if (mInstance && mSoloud)
266 {
267 mSoloud->lockAudioMutex();
268 float temp[1024];
269 int i;
270 for (i = 0; i < 256; i++)
271 {
272 temp[i*2] = mInstance->mVisualizationWaveData[i];
273 temp[i*2+1] = 0;
274 temp[i+512] = 0;
275 temp[i+768] = 0;
276 }
277 mSoloud->unlockAudioMutex();
278
279 SoLoud::FFT::fft1024(temp);
280
281 for (i = 0; i < 256; i++)
282 {
283 float real = temp[i * 2];
284 float imag = temp[i * 2 + 1];
285 mFFTData[i] = (float)sqrt(real*real+imag*imag);
286 }
287 }
288
289 return mFFTData;
290 }
291
292 float * Bus::getWave()
293 {

Callers

nothing calls this directly

Calls 3

fft1024Function · 0.85
lockAudioMutexMethod · 0.80
unlockAudioMutexMethod · 0.80

Tested by

no test coverage detected