Skip to content

AmbientSound

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QAmbientSound
PySide6.QtSpatialAudio
QAmbientSound(self, engine: PySide6.QtSpatialAudio.QAudioEngine, /, *, source: PySide6.QtCore.QUrl | None \= None, volume: float | None \= None, loops: int | None \= None, autoPlay: bool | None \= None) -> None

⋔ Inheritance diagram

graph TD
  3540346505["spatialaudio.AmbientSound"]
  3227531497["core.ObjectMixin"]
  2751680898["builtins.object"]
  3264700512["QtSpatialAudio.QAmbientSound"]
  3984060476["QtCore.QObject"]
  37984305["Shiboken.Object"]
  3227531497 --> 3540346505
  2751680898 --> 3227531497
  3264700512 --> 3540346505
  3984060476 --> 3264700512
  37984305 --> 3984060476
  2751680898 --> 37984305

🛈 DocStrings

Bases: ObjectMixin, QAmbientSound

A stereo overlay sound.

Source code in prettyqt/spatialaudio/ambientsound.py
class AmbientSound(core.ObjectMixin, QtSpatialAudio.QAmbientSound):
    """A stereo overlay sound."""

    def set_source(self, source: datatypes.UrlType):
        self.setSource(datatypes.to_local_url(source))

    def get_source(self) -> pathlib.Path:
        url = self.source()
        return pathlib.Path(url.toLocalFile() if url.isLocalFile() else url.toString())

:fa-brands-github: Show source on GitHub