Author Topic: Get certain frequencies using ChannelGetData  (Read 224 times)

Blink123123

  • Posts: 28
Hello,

I am implementing BASS using C++, I have the data of the stream using ChannelGetData but I don't know how to process the data to check for bass, mid and treble peaks.

I was able to do so using utils with C# BASS, but in C++ I don't see this function.

Should I divide the data I have in three parts and check them? i.e. the first third will be bass the second third will be mid and the third part will be treble?

Ian @ un4seen

  • Administrator
  • Posts: 21861
Re: Get certain frequencies using ChannelGetData
« Reply #1 on: 13 May '19 - 14:02 »
Yes, you would split the FFT data into 3 bands but probably not evenly, ie. not into thirds. You can calculate the split points like this:

Code: [Select]
BASS_CHANNELINFO info;
BASS_ChannelGetInfo(handle, &info);
int split1 = fftsize * band2start / info.freq + 0.5;
int split2 = fftsize * band3start / info.freq + 0.5;

Where "band2start" and "band3start" are the frequencies that the 2nd and 3rd bands start at (eg. something like 250 and 4000), and "fftsize" is determined by the BASS_DATA_FFT flag used in the BASS_ChannelGetData call (eg. BASS_DATA_FFT512 = 512).

Blink123123

  • Posts: 28
Re: Get certain frequencies using ChannelGetData
« Reply #2 on: 18 May '19 - 08:39 »
Thanks Ian!

Worked on the first try