Implement real-time BPM (beats per minute) estimation in AudioAnalyzer by tracking beat intervals and smoothing the result. Display the current BPM in both the window title and the on-screen HUD. Update AudioFeatures to include a Bpm field. Adjust HUD layout to accommodate the new BPM information.
22 lines
441 B
C#
22 lines
441 B
C#
namespace FractalVisualizer.Models;
|
|
|
|
public struct AudioFeatures
|
|
{
|
|
public float Level;
|
|
public float Bass;
|
|
public float Mid;
|
|
public float High;
|
|
public float Beat;
|
|
public float Bpm;
|
|
public float[] Spectrum;
|
|
public float TimeSeconds;
|
|
|
|
public static AudioFeatures CreateEmpty(int spectrumBins)
|
|
{
|
|
return new AudioFeatures
|
|
{
|
|
Spectrum = new float[spectrumBins]
|
|
};
|
|
}
|
|
}
|