In this block of code in recorderui:
average = (data + data2)/2.0
if not self.mute:
if self.lowaudio_threshold and average < (self.lowaudio_threshold):
self.dispatcher.emit("low-audio")
self.low_audio = True
if average < (self.thresholdVum):
self.dispatcher.emit("audio-mute")
self.mute = True
if self.mute and average > (self.thresholdVum + 5.0):
self.dispatcher.emit("audio-recovered")
self.mute = False
if self.low_audio and self.lowaudio_threshold and average > (self.lowaudio_threshold + 5.0):
self.dispatcher.emit("low-audio-recovered")
self.low_audio = False
the audio level is calculated by averaging the left and right channels.
It makes more sense to use the larger value of the two channels for audio threshold purposes, e.g.
audio_level = max(data, data2)
For example if you have different mic inputs on L&R and you expect > -50 dB on both of them, and set low audio threshold = -55, but then unplug the R mic (or it's switched off), and now you have -50 dB left and -80 or lower on right, so the average drops below the threshold, even though you still have a perfectly good audio signal.
In this block of code in recorderui:
the audio level is calculated by averaging the left and right channels.
It makes more sense to use the larger value of the two channels for audio threshold purposes, e.g.
For example if you have different mic inputs on L&R and you expect > -50 dB on both of them, and set low audio threshold = -55, but then unplug the R mic (or it's switched off), and now you have -50 dB left and -80 or lower on right, so the average drops below the threshold, even though you still have a perfectly good audio signal.