def volumeChange(self, volume: int) -> None: logVolume = QAudio.convertVolume(volume / 100, QAudio.LogarithmicVolumeScale, QAudio.LinearVolumeScale) * 100 self.player.setVolume(logVolume) self.volume = volume self.mediaControlArea.updateVolumeBar(volume)
def set_volume(self, volume): log_volume = QAudio.convertVolume(volume / 100, QAudio.LinearVolumeScale, QAudio.LogarithmicVolumeScale)
def volume(self): linear_volume = QAudio.convertVolume(self.volume_slider.value() / 100, QAudio.LogarithmicVolumeScale, QAudio.LinearVolumeScale) return qRound(linear_volume * 100)