k after searching on how to get the GetSpectrum thing to work i came up with the following
‘declared in public in a module
Public Spectrum(511) as single
Public Sub GetSpectrum()
FSOUND_DSP_SetActive FSOUND_DSP_GetFFTUnit, 1
Dim nrOfVals As Long, lpSpectrum As Long
Dim a As Long
lpSpectrum = FSOUND_DSP_GetSpectrum
CopyMemory Spectrum(0), lpSpectrum, 512 * 4
then when i call the sub, it will update the Spectrum() array, and i get numbers like 2.382207E-44 usually grouped to gether (if you look at the array) and other than that theres a bunch of zeros
this is probably a dumb question but i donno what i should do to get a range (like is there a max and min the numbers could be, or should i change the type or somethin)
thx in advance
- mastercactapus asked 13 years ago
ya i realized that later lol and i donno y i didnt figure that out from the start (mabye i was thinkin of somethin else like oliscoper for some reason), but i did post it right after i got up, but whatever
now it gives me the same results every time, the numbers dont change, sound is playing and everything but the numbers i get back dont change at all, they stay the same zeros stay zeroes and the other numbers stay at whatever they are
-First of all the Sub above must be called from a timer ( in case you didn’t do that).you would better set the interval of the timer to 15 milliseconds( i use an API timer to do that cause VB6 timers are buggy Under 100 millisecond interval).
-You have to call to Get FFT Unit and activate it only once while intializing fmod, not every time you call to get a spectrum
-In VB6 i had to create dsp unit using the (Fsound_stream_createdsp) function for spectrum to work, In c++ i didn’t have to that,you can refer to the documantation to get more info on how to create a dsp unit and its callback.
Hope this will help you
- Anonymous answered 13 years ago
The range that is in zero is because in that frequency there is not volume. For example, if you are listening a bass will see that the lowest frequencies have a value and the highest go falling until arriving to zero. This means that the biggest volume is in the lowest frequencies.
This is used to analyze the spectrum of frequencies. And it works this way…
- LeoCombes answered 13 years ago
Please login first to submit.