Skip to content

AudioFormat

Base classes

Name Children Inherits
QAudioFormat
PySide6.QtMultimedia
QAudioFormat(self, /) -> None

⋔ Inheritance diagram

graph TD
  3905945910["multimedia.AudioFormat"]
  2462101364["QtMultimedia.QAudioFormat"]
  37984305["Shiboken.Object"]
  2751680898["builtins.object"]
  2462101364 --> 3905945910
  37984305 --> 2462101364
  2751680898 --> 37984305

🛈 DocStrings

Bases: QAudioFormat

Source code in prettyqt/multimedia/audioformat.py
class AudioFormat(QtMultimedia.QAudioFormat):
    def set_sample_format(
        self, mode: SampleFormatStr | QtMultimedia.QAudioFormat.SampleFormat
    ):
        self.setSampleFormat(SAMPLE_FORMAT.get_enum_value(mode))

    def get_sample_format(self) -> SampleFormatStr:
        return SAMPLE_FORMAT.inverse[self.sampleFormat()]

    def set_channel_config(
        self, config: ChannelConfigStr | QtMultimedia.QAudioFormat.ChannelConfig
    ):
        self.setChannelConfig(CHANNEL_CONFIG.get_enum_value(config))

    def get_channel_config(self) -> ChannelConfigStr:
        return CHANNEL_CONFIG.inverse[self.channelConfig()]

:fa-brands-github: Show source on GitHub