20 Jun '13 - 05:47 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: FFT processing frame size question (BASS_ChannelGetData)  (Read 931 times)
sunhyung
Posts: 5


« on: 26 Jan '11 - 00:07 »
Reply with quoteQuote

I try to extract sound feature with BASS, so want to check something...

Look at below codes...
(Exclude error processing)

BASS_Init(-1, 44100, 0, hwnd, NULL);
BASS_SetConfig(BASS_CONFIG_BUFFER, 300);
HSTREAM stream = BASS_StreamCreateFile(FALSE, _T("C:\\TestAudio\\1.mp3"), 0, 0, BASS_STREAM_DECODE | BASS_STREAM_PRESCAN | BASS_UNICODE);

float fft[2048];
memset(fft, 0, 2048 * sizeof(float));
BASS_ChannelGetData(stream, fft, BASS_DATA_FFT4096); // <----- Here

In above codes, How many time domain data use to process FFT in BASS_ChannelGetData?

BASS_CONFIG_BUFFER size? (in this case, 300ms)
Logged
sunhyung
Posts: 5


« Reply #1 on: 26 Jan '11 - 08:17 »
Reply with quoteQuote

Oh...it's not fixed frame...
To confirm it, I checked return value of BASS_ChannelGetData.

According to BASS_ChannelGetData description...
Quote
Return value
If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code. When requesting FFT data, the number of bytes read from the channel (to perform the FFT) is returned.

So using BASS_DATA_FFT256, BASS_ChannelGetData uses 256 samples(each channel) to perform FFT.
« Last Edit: 26 Jan '11 - 08:26 by sunhyung » Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines