23 May '13 - 19:05 *
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: Frequency Data in BASS  (Read 341 times)
Robert955
Posts: 2


« on: 27 Aug '12 - 22:19 »
Reply with quoteQuote

I have a brief question: Is there a way to predetermine ferquency data (without actually playing a song)?

thx
Logged
saga
Posts: 1365


« Reply #1 on: 28 Aug '12 - 13:35 »
Reply with quoteQuote

Use a decoding channel (e.g. using the BASS_STREAM_DECODE flag)
« Last Edit: 28 Aug '12 - 13:45 by saga » Logged
Ian @ un4seen
Administrator
Posts: 15270


« Reply #2 on: 28 Aug '12 - 17:15 »
Reply with quoteQuote

By "frequency data", do you mean FFT data? If so, you can use BASS_ChannelGetData to get that from the "decoding channel" that you created with the BASS_STREAM_DECODE flag. To process an entire file, you might do something like this...

decoder=BASS_StreamCreateFile(FALSE, filename, 0, 0, BASS_STREAM_DECODE); // create a decoding channel for a file
while (BASS_ChannelIsActive(decoder)) { // not at the end yet
float fft[256];
BASS_ChannelGetData(decoder, fft, BASS_DATA_FFT512); // perform a 512 sample FFT
// do something with the FFT data in the "fft" array here
}

Please see the BASS_ChannelGetData documentation for details on that.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines