drumscript.audio_processor.tempo_detector.estimate_tempo

estimate_tempo(audio_path, sr)[source]

Estimates tempo from the tempogram, but restricted to a plausible range. (Corrected to avoid INF and extreme BPM errors, ie 10500 BPM). Returns a default 120.0 BPM if the audio is too short to analyze.

Parameters:
  • audio_path (np.ndarray) – The input audio time series.

  • sr (int) – Sampling rate of the audio.

Returns:

The estimated tempo in Beats Per Minute (BPM).

Return type:

float