AmbientSound QML 類型

A stereo overlay sound. 更多...

import 語句: import QtQuick3D.SpatialAudio

特性

方法

詳細描述

A AmbientSound 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.

特性文檔編製

autoPlay : bool

Determines whether the sound should automatically start playing when a source gets specified.

默認值為 true .

loops : int

Determines how often the sound is played before the player stops. Set to QAmbienSound::Infinite to loop the current sound forever.

默認值為 1 .

source : url

The source file for the sound to be played.

volume : real

Defines an overall volume for this sound source.

方法文檔編製

pause ()

Pauses sound playback at the current position. Calling play () will continue playback.

play ()

Starts playing back the sound. Does nothing if the sound is already playing.

stop ()

Stops sound playback and resets the current position and loop count to 0. Calling play () will begin playback at the beginning of the sound file.