0
0

hey i have a problem using FSOUND_DSP_GetSpectrum(), it always returns a float whose value is 0.

this is how i load the file:
[code:2u5i50b7]
if( FSOUND_Init ( 44100, 32, 0 ) )

c_Stream = FSOUND_Stream_Open ( filename, FSOUND_MPEGACCURATE, 0, 0 );

if ( c_Stream != NULL )
FSOUND_Stream_Play ( FSOUND_FREE, c_Stream );

FSOUND_DSP_SetActive( FSOUND_DSP_GetFFTUnit(), TRUE );
[/code:2u5i50b7]

Then i use this to read it every frame:
[code:2u5i50b7]
float *spectrum;
spectrum = FSOUND_DSP_GetSpectrum();
[/code:2u5i50b7]

spectrum is always 0.0f. i tried everything and its not working at all. thanks in advance, id be glad if you could help me out.

  • You must to post comments
0
0

umm its an mp3 file. it loads and plays fine, etc. I looked at the whole array. Im using MSVC++ .NET if that makes a diffrence. I don’t even think its an array, because in the debugger watch it shows it as 0.00000000 too, and not an array.

  • You must to post comments
0
0

shouldn’t you have to specify the fact that it is an array of floats?

i.e. with [] brackets somewhere?

  • You must to post comments
0
0

It usually doesnt show up as an array if u use * just go through the data as u would in a normal array.

[code:215tpj5g]
for(int i=0; i < 256; i++)
{
float data = spectrum[i];
}
[/code:215tpj5g]

Use 256 as i think the size of the array is 255

  • You must to post comments
0
0

ok thx for all the help it now works. i used the info from this link to fix it:
[url:16065ei2]http://www.gamedev.net/community/forums/topic.asp?topic_id=297454[/url:16065ei2]

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.