chrvadala / music-beat-detector

music-beat-detector is a library that analyzes a music stream and detects any beat. It can be used to control lights or any magic effect by the music wave.
MIT License
255 stars 25 forks source link

Silence causes excessive processing time #2

Open 0m-ax opened 5 years ago

0m-ax commented 5 years ago

If the audio source is completely silent then it can take up to 20ms to process a single packet of data, thus causing the audio output to become delayed. This is caused by SlidingWindowMax. It can be fixed by reducing SAMPLES_WINDOW to 0.5 the frequency but this does not seem like a very elegant solution.

chrvadala commented 5 years ago

Could you attach a sample on this issue?