mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-04 13:47:37 +02:00
Don't fail on 0 rms (#8447)
This commit is contained in:
parent
b54aaad382
commit
7270eef6bf
@ -240,7 +240,10 @@ class AudioEventMaintainer(threading.Thread):
|
|||||||
rms = np.sqrt(np.mean(np.absolute(np.square(audio_as_float))))
|
rms = np.sqrt(np.mean(np.absolute(np.square(audio_as_float))))
|
||||||
|
|
||||||
# Transform RMS to dBFS (decibels relative to full scale)
|
# Transform RMS to dBFS (decibels relative to full scale)
|
||||||
dBFS = 20 * np.log10(np.abs(rms) / AUDIO_MAX_BIT_RANGE)
|
if rms > 0:
|
||||||
|
dBFS = 20 * np.log10(np.abs(rms) / AUDIO_MAX_BIT_RANGE)
|
||||||
|
else:
|
||||||
|
dBFS = 0
|
||||||
|
|
||||||
self.inter_process_communicator.queue.put(
|
self.inter_process_communicator.queue.put(
|
||||||
(f"{self.config.name}/audio/dBFS", float(dBFS))
|
(f"{self.config.name}/audio/dBFS", float(dBFS))
|
||||||
|
Loading…
Reference in New Issue
Block a user