QAmbientSound#
A stereo overlay sound. More…
Synopsis#
Functions#
Slots#
Signals#
def
autoPlayChanged
()def
loopsChanged
()def
sourceChanged
()def
volumeChanged
()
Detailed Description#
QAmbientSound
represents a position and orientation independent sound. It’s commonly used for background sounds (e.g. music) that is supposed to be independent of the listeners position and orientation.
- class PySide6.QtSpatialAudio.QAmbientSound(engine)#
- Parameters
engine –
PySide6.QtSpatialAudio.QAudioEngine
Creates a stereo sound source for engine
.
- PySide6.QtSpatialAudio.QAmbientSound.Loops#
- PySide6.QtSpatialAudio.QAmbientSound.autoPlay()#
- Return type
bool
Determines whether the sound should automatically start playing when a source gets specified.
The default value is true
.
- PySide6.QtSpatialAudio.QAmbientSound.autoPlayChanged()#
- PySide6.QtSpatialAudio.QAmbientSound.engine()#
- Return type
Returns the engine associated with this sound.
- PySide6.QtSpatialAudio.QAmbientSound.loops()#
- Return type
int
Determines how many times the sound is played before the player stops. Set to QAmbientSound::Infinite to play the current sound in a loop forever.
The default value is 1
.
- PySide6.QtSpatialAudio.QAmbientSound.loopsChanged()#
- PySide6.QtSpatialAudio.QAmbientSound.pause()#
Pauses sound playback. Calling play()
will continue playback.
- PySide6.QtSpatialAudio.QAmbientSound.play()#
Starts playing back the sound. Does nothing if the sound is already playing.
- PySide6.QtSpatialAudio.QAmbientSound.setAutoPlay(autoPlay)#
- Parameters
autoPlay – bool
Determines whether the sound should automatically start playing when a source gets specified.
The default value is true
.
- PySide6.QtSpatialAudio.QAmbientSound.setLoops(loops)#
- Parameters
loops – int
Determines how many times the sound is played before the player stops. Set to QAmbientSound::Infinite to play the current sound in a loop forever.
The default value is 1
.
- PySide6.QtSpatialAudio.QAmbientSound.setSource(url)#
- Parameters
url –
PySide6.QtCore.QUrl
The source file for the sound to be played.
- PySide6.QtSpatialAudio.QAmbientSound.setVolume(volume)#
- Parameters
volume – float
Defines the volume of the sound.
Values between 0 and 1 will attenuate the sound, while values above 1 provide an additional gain boost.
- PySide6.QtSpatialAudio.QAmbientSound.source()#
- Return type
The source file for the sound to be played.
- PySide6.QtSpatialAudio.QAmbientSound.sourceChanged()#
- PySide6.QtSpatialAudio.QAmbientSound.stop()#
Stops sound playback and resets the current position and current loop count to 0. Calling play()
will start playback at the beginning of the sound file.
- PySide6.QtSpatialAudio.QAmbientSound.volume()#
- Return type
float
Defines the volume of the sound.
Values between 0 and 1 will attenuate the sound, while values above 1 provide an additional gain boost.
- PySide6.QtSpatialAudio.QAmbientSound.volumeChanged()#