0
0

Hello ,

I need for my project audio analyzer, but i dont know where i draw spectrum effect :( or wave and i see exaples but for c# a I need c++ code and with FmodEx. I have vlc Forms App in Turbo c++

Thank you for answers

Carda

  • You must to post comments
0
0

Hi Carda, welcome to the FMOD forums.

You can use FMOD_Channel_GetSpectrum to retrieve the spectrum data from a playing sound. How you display that data is up to you.

  • You must to post comments
0
0

Hello ,

Ok I have this function

void drawSpectrum()
{

        const int GRAPHICWINDOW_WIDTH = 504;
        const int GRAPHICWINDOW_HEIGHT = 180;  
        const int SPECTRUMSIZE = 512;
        int numchannels                   = 0;
        int dummy                         = 0;
        int count                         = 0;
        int count2                        = 0;
        float* spectrum = new float[SPECTRUMSIZE];

        /*
                DRAW SPECTRUM
        */
        for (count = 0; count < numchannels; count++)
        {
            float max = 0;

            res = FMOD_Chanel_GetSpectrum(chanel,spectrum, SPECTRUMSIZE, count, FMOD.DSP_FFT_WINDOW.TRIANGLE);

            for (count2 = 0; count2 < 255; count2++)
            {
                if (max < spectrum[count2])
                {
                    max = spectrum[count2];
                }
            }

            for (count2 = 0; count2 < 255; count2++)
            {
                float height;

                height = spectrum[count2] / max * GRAPHICWINDOW_HEIGHT;

                if (height >= GRAPHICWINDOW_HEIGHT)
                {
                    height = GRAPHICWINDOW_HEIGHT - 1;
                }

                if (height < 0)
                {
                    height = 0;
                }

                height = GRAPHICWINDOW_HEIGHT - height;

                Form1->Image1->Canvas->Rectangle(count2, height, 1.0f, GRAPHICWINDOW_HEIGHT - height);
            }
        }
    }

Why don´t draw? And got an any example please?

  • You must to post comments
0
0

Code looks OK, I’m not sure about what library you are using to draw there but the FMOD part of the code looks fine.

  • You must to post comments
0
0

Hello,

thank you for checked my FMOD code. You have no poniet as a library use for drawing 😥 , because I need it for my maturita exams :(

  • You must to post comments
0
0

You’re welcome, you might be able to with the drawing code on forums specialized for that. Good luck with your exams. :)

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.