If I understand this getspectrum function correctly, it gets the amplitudes for the frequencies at points in time and at each interval provides these to me via a pointer to an array of 512 float values.
Are these amplitudes only taken once during the sample? And even if they are, why would the following code only produce zeros in all the 512 frequencies? I am getting the sound from a file that is playing on my speakers
Here’s my question. The code below doesn’t work because I have no way to insert the whatever pointer inquiry at the right time to catch each interval’s measurements in the sample. (sample is 5 seconds long)
whatever=FSOUND_DSP_GetSpectrum(); // does this line go here?
cout<<(whatever+n)<<endl; //this line prints 512 zeros for any n
} while (FSOUND_IsPlaying(channel) && !kbhit());
I hate to keep asking about this but I have never had any problems using fmod previously and this one is baffling.
- joedart asked 9 years ago
The pointer points to an array whose address is in *whatever that is loaded with zeros. The 512 frequencies never have any amplitudes. They are always zero.
That’s that problem I am having. Where are the numbers I am supposed to be getting? And also, where do I put the getspectrum line of code in order to obtain each FFT it calculates?
- joedart answered 9 years ago
Please login first to submit.