void AnalyseSong(string filePath) { // Add the audio file name to the window title this.Window.Title = "11010841 Proof of Concept - " + filePath; // Load the audio file from the given file path audioAnalysis.LoadAudioFromFile(filePath); // Find the onsets //audioAnalysis.PerformSpectralFlux(ONSET_SENSITIVITY); audioAnalysis.DetectOnsets(ONSET_SENSITIVITY); // Normalize the intensity of the onsets audioAnalysis.NormalizeOnsets(0); }
public void Initialize(ISampleSource soundSource, GeneratorOptions options) { analysis = new AudioAnalysis(); analysis.PCMStream = soundSource; analysis.DetectOnsets(); analysis.NormalizeOnsets(0); analysis.PCMStream.Position = 0; fps = options.Fps; Console.WriteLine("Audio analyzer detected " + analysis.GetOnsets().Count(f => f > 0) + " onsets!"); }