0
0

float spectrum[64];
sys->getSpectrum(spectrum,64,0,FMOD_DSP_FFT_WINDOW_RECT);

it’s good? It’s doesn’t work :/ I try averything, channel, system, channelgroup, etc…

Items in spectrum have 0, -431602080.000000, why i write here, becouse i take 128 float’s from left channel 0, right channel 1, getSpectrum or getWaveData. And always I have 256 Items with that same count. :/
Mayby somebody know what I make bad?
Greetings.

  • You must to post comments
0
0

First: no.
Second: Hmm I don’t think so. Actually I use stream, but I think that there I should load this with FMOD_SOFTWARE. I use FMOD_DEFAULT. When I use FMOD_2D, FMOD_3D, FMOD_SOFTWARE, it’s doesn’t work.
Also I can’t set second driver (Creative Sound Blaster 24bit), I must use first “standart”.

  • You must to post comments
0
0

void InitFMOD(HWND hWnd)
{
int driver=0;
FMOD_OUTPUTTYPE output;
//FMOD::Memory_Initialize(malloc(10 * 10241024), 10 * 10241024, 0, 0, 0);
FMOD::System_Create(&sys);
[color=red:211cjszy]sys->init(32,FMOD_INIT_NORMAL,(void*)0);[/color:211cjszy]
sys->getOutput(&output);
sys->getDriver(&driver);
sys->setOutput(output);
sys->setDriver(driver);
}

It’s OK.

void InitFMOD(HWND hWnd)
{
int driver=0;
FMOD_OUTPUTTYPE output;
//FMOD::Memory_Initialize(malloc(10 * 10241024), 10 * 10241024, 0, 0, 0);
FMOD::System_Create(&sys);
[color=red:211cjszy]sys->init(32,FMOD_SOFTWARE,(void*)0);[/color:211cjszy]
sys->getOutput(&output);
sys->getDriver(&driver);
sys->setOutput(output);
sys->setDriver(driver);
}

It’s not OK.

[code:211cjszy]void DrawSpectrum(void)
{
int y=0,x=0;
float spectrum[128];

for(x=0; x<80 ;x++)       
    for(y=0; y<40 ;y++)   //graph->Clear(Gdiplus::Color::Black); 
        hBitmap->SetPixel(x,y,Gdiplus::Color::Black); // White
//memset(hBitmap,0,sizeof(hBitmap));

FILE *plik = fopen("bldsa.txt","w");

sys->getSpectrum(spectrum,128,0,FMOD_DSP_FFT_WINDOW_RECT);
//group->getSpectrum(spectrum,128,0,FMOD_DSP_FFT_WINDOW_RECT);
for(int j=0; j<128; j++)
    fprintf(plik,"%f   ",spectrum[j]);
fputc(10,plik);
fputc(10,plik);

/*sys->getSpectrum(spectrum,128,1,FMOD_DSP_FFT_WINDOW_RECT);
for(int j=0; j<128; j++)
    fprintf(plik,"%f   ",spectrum[j]);
fputc(10,plik);
fputc(10,plik);*/

fclose(plik);
/*  paski leca w bok po ukosie
    hBitmap->SetPixel(x+z,y,(Color&)*kolor);
    z++;
    hBitmap->SetPixel(x+z,y,(Color&)*kolor); */
/*  paski grubsze (podwojne)
    hBitmap->SetPixel(x+z,y,(Color&)*kolor);
    hBitmap->SetPixel(x+z+1,y,(Color&)*kolor); 
    } z++;                                  */
//hBitmap->RotateFlip(Gdiplus::Rotate180FlipX);
graph->DrawImage(hBitmap,(float)0.0f,(float)0.0f,(float)80.0f,(float)40.0f);

}[/code:211cjszy]

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.