Skip to content

Commit

Permalink
OPENCAST-2377 Use max rather than average of L/R channels for audio p…
Browse files Browse the repository at this point in the history
…lugins teltek#616
  • Loading branch information
smarquard committed Apr 11, 2019
1 parent f0c482b commit 087f00d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions galicaster/classui/recorderui.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ def scale_data(self,data, data2):
if data2 == "Inf":
data2 = -200

average = (data + data2)/2.0
audio_level = max(data, data2)
if not self.mute:
if self.lowaudio_threshold and average < (self.lowaudio_threshold):
if self.lowaudio_threshold and audio_level < (self.lowaudio_threshold):
self.dispatcher.emit("low-audio")
self.low_audio = True
if average < (self.thresholdVum):
if audio_level < (self.thresholdVum):
self.dispatcher.emit("audio-mute")
self.mute = True
if self.mute and average > (self.thresholdVum + 5.0):
if self.mute and audio_level > (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):
if self.low_audio and self.lowaudio_threshold and audio_level > (self.lowaudio_threshold + 5.0):
self.dispatcher.emit("low-audio-recovered")
self.low_audio = False

Expand Down

0 comments on commit 087f00d

Please sign in to comment.