Reinitialise audio output on every load, to fix silent channels.

This commit is contained in:
Matthew Stratford 2021-09-02 00:35:03 +01:00
parent 7d2757a67d
commit 2fdc9bf0e9

View file

@ -394,9 +394,13 @@ class Player:
def load(self, weight: int): def load(self, weight: int):
if not self.isPlaying: if not self.isPlaying:
loaded_state = self.state.get()
self.unload() self.unload()
showplan = self.state.get()["show_plan"] self.logger.log.info("Resetting output (in case of sound output gone silent somehow) to " + str(loaded_state["output"]))
self.output(loaded_state["output"])
showplan = loaded_state["show_plan"]
loaded_item: Optional[PlanItem] = None loaded_item: Optional[PlanItem] = None