← Back to Docs
  • index.html
  • Clayground
  • Clayground.Sound
  • Sound
  • Clayground 2026.2
  • Sound QML Type

    Play sound effects with support for overlapping playback. More...

    Import Statement: import Clayground.Sound

    Detailed Description

    Sound provides an easy-to-use interface for playing short sound effects like jump sounds, clicks, explosions, etc. Multiple instances of the same sound can play simultaneously (overlapping).

    Properties

    The audio file URL to load (local or remote).

    Volume level from 0.0 (silent) to 1.0 (full). Default: 1.0

    If true, audio loads on first play() call. If false (default), loads immediately.

    Read-only. True when audio data is fully loaded and ready to play.

    Read-only. Current loading status:

    Methods

    Plays the sound. Can be called multiple times for overlapping playback. If not loaded, triggers lazy loading then plays.

    Stops all currently playing instances of this sound.

    Explicitly preloads the audio (useful with lazyLoading enabled).

    Signals

    Emitted when playback completes.

    Emitted when loading or playback fails.

    See also Music.