Skip to content

Use max rather than average of L/R channels for audio plugins #616

@smarquard

Description

@smarquard

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureUse this label for new features or enhancements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions