Beispiel #1
0
        public float[] getWaveData(int size, int channel)
        {
            float[] data = new float[size];

            m_system.getWaveData(data, size, channel);
            return(data);
        }
Beispiel #2
0
        private void drawOscilliscope(Graphics g)
        {
            int numchannels = 0;
            int dummy       = 0;

            FMOD.SOUND_FORMAT  dummyformat    = FMOD.SOUND_FORMAT.NONE;
            FMOD.DSP_RESAMPLER dummyresampler = FMOD.DSP_RESAMPLER.LINEAR;
            int count  = 0;
            int count2 = 0;

            system.getSoftwareFormat(ref dummy, ref dummyformat, ref numchannels, ref dummy, ref dummyresampler, ref dummy);

            /*
             *      DRAW WAVEDATA
             */
            for (count = 0; count < numchannels; count++)
            {
                system.getWaveData(wavedata, WAVEDATASIZE, count);

                for (count2 = 0; count2 < WAVEDATASIZE - 1; count2++)
                {
                    float y;

                    y = (wavedata[count2] + 1) / 2.0f * GRAPHICWINDOW_HEIGHT;

                    g.FillRectangle(mBrushWhite, count2 + GRAPHICWINDOW_WIDTH - WAVEDATASIZE - 10.0f, y, 1.0f, 1.0f);
                }
            }
        }