public void PushSample(AudioAnalysisSample sample) { if (sample.Spectrum.Length < Globals.SPECTRUMRES * 2) { throw new IndexOutOfRangeException("spectrumData not large enough"); } if (sample.Spectrum2.Length < Globals.SPECTRUM2RES) { throw new IndexOutOfRangeException("spectrumData not large enough"); } samplesPerFrame = sample.Samples; TotalSamples += sample.Samples; SamplePosition++; SamplePosition %= SAMPLEHISTORY; SpectrumTex.RefreshImage(sample.Spectrum, 0, SamplePosition, Globals.SPECTRUMRES, 1); Spectrum2Tex.RefreshImage(sample.Spectrum2, 0, SamplePosition, Globals.SPECTRUM2RES, 1); AudioDataTex.RefreshImage(sample.AudioData, 0, SamplePosition, Globals.AUDIODATASIZE, 1); }
public void AddSample(AudioAnalysisSample sample) { SampleQueue.Enqueue(sample); }