0
0

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)

float whatever;
do
{
whatever=FSOUND_DSP_GetSpectrum(); // does this line go here?
cout<<
(whatever+n)<<endl; //this line prints 512 zeros for any n
sleep(50);
} 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.

thanks

joe

  • You must to post comments
0
0

FSOUND_DSP_GetSpectrum returns the pointer to an array of 512 floats. (See doc)

  • You must to post comments
0
0

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?

Thanks

joe

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.