gtreshchev / AudioAnalysisTools

Audio Analysis Tools plugin for Unreal Engine. Provides a variety of functions for analyzing audio data. Works in conjunction with the Runtime Audio Importer plugin.
MIT License
103 stars 17 forks source link

FFTSubbandsSize cannot be set higher than 512 or beat detection fails #5

Closed Caffiendish closed 2 years ago

Caffiendish commented 2 years ago

If FFTSubbandsSize is set higher than 512, beat detection fails every frame.

gtreshchev commented 2 years ago

This is because of the buffer size you are probably getting from OnGeneratePCMData. I assume you have two channels (so the PCM data size is 1024 each generation), and therefore your sample size is 512.

Caffiendish commented 2 years ago

So, the FFTSubbandSize shouldn't allow being set higher than the possible sample size, or should set itself accordingly upon receiving the first frame where it's set higher than could be useful?

gtreshchev commented 2 years ago

First is right, the FFTSubbandSize shouldn't allow being set higher than the possible sample size. The second one may also be true, but this does not follow directly from the algorithm, so need to test this approach to be sure.