fix volume input sinks to handle also mono streams

This commit is contained in:
2023-12-10 04:19:05 +01:00
parent 310d396407
commit dec5642e26
2 changed files with 6 additions and 2 deletions

View File

@@ -300,7 +300,11 @@ class Volume(Div):
volume_level = 0
if self.pa_state: # might be empty {} if it is not found
# pulseaudio 2^16 (65536) volume levels
volume_level = float(self.pa_state['volume']['front-left']['value_percent'][:-1]) # remove the % sign
if 'front-left' in self.pa_state['volume']:
volume_level = float(self.pa_state['volume']['front-left']['value_percent'][:-1]) # remove the % sign
elif 'mono' in self.pa_state['volume']:
volume_level = float(self.pa_state['volume']['mono']['value_percent'][:-1]) # remove the % sign
# TODO: ? indicator if stream is stereo or mono ?
badge = QBadge(
text=badge_name,