Qt Mobility Reference Documentation

QML SoundEffect Element

The SoundEffect element provides a way to play sound effects in QML. More...

Properties

Signals

Detailed Description

This element is part of the Qt.multimedia 1.0 module.

The following example plays a wav file on mouse click.

 import Qt 4.7
 import Qt.multimedia 1.0

 Text {
     text: "Click Me!";
     font.pointSize: 24;
     width: 150; height: 50;

     SoundEffect {
         id: playSound
         source: "soundeffect.wav"
     }
     MouseArea {
         id: playArea
         anchors.fill: parent
         onPressed: { playSound.play() }
     }
 }

Property Documentation

loops : int

This property provides a way to control the number of times to repeat the sound on each play().


muted : bool

This property provides a way to control muting.


source : url

This property provides a way to control the sound to play.


volume : int

This property provides a way to control the volume for playback.


Signal Documentation

SoundEffect::loopsChanged ()

This handler is called when the number of loops has changes.


SoundEffect::mutedChanged ()

This handler is called when the mute state has changed.


SoundEffect::sourceChanged ()

This handler is called when the source has changed.


SoundEffect::volumeChanged ()

This handler is called when the volume has changed.


X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.