This file is indexed.

/usr/share/qt5/doc/qtmultimedia/qml-qtmultimedia-soundeffect.html is in qtmultimedia5-doc-html 5.2.1-0ubuntu5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qsoundeffect.cpp -->
  <title>SoundEffect | QtMultimedia 5.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li>Qt 5.2</li>
<li><a href="qtmultimedia-index.html">Qt Multimedia</a></li>
<li><a href="qtmultimedia-qmlmodule.html">QML Types</a></li>
<li>SoundEffect</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">SoundEffect</h1>
<span class="subtitle"></span>
<!-- $$$SoundEffect-brief -->
<p>The SoundEffect type provides a way to play sound effects in QML. <a href="#details">More...</a></p>
<!-- @@@SoundEffect -->
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> </b><tt>import QtMultimedia 5.0</tt></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Instantiates:</td><td class="memItemRight bottomAlign"> <a href="qsoundeffect.html">QSoundEffect</a></td></tr></table><ul>
<li><a href="qml-qtmultimedia-soundeffect-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#category-prop">category</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#loops-prop">loops</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#loopsRemaining-prop">loopsRemaining</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#muted-prop">muted</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#playing-prop">playing</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#source-prop">source</a></b></b> : url</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#status-prop">status</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#volume-prop">volume</a></b></b> : qreal</li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#categoryChanged-signal">categoryChanged</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#loadedChanged-signal">loadedChanged</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#loopCountChanged-signal">loopCountChanged</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#loopsRemainingChanged-signal">loopsRemainingChanged</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#mutedChanged-signal">mutedChanged</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#playingChanged-signal">playingChanged</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#sourceChanged-signal">sourceChanged</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#statusChanged-signal">statusChanged</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#volumeChanged-signal">volumeChanged</a></b></b>()</li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn">bool <b><b><a href="qml-qtmultimedia-soundeffect.html#isLoaded-method">isLoaded</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#play-method">play</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtmultimedia-soundeffect.html#stop-method">stop</a></b></b>()</li>
</ul>
<!-- $$$SoundEffect-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>SoundEffect is part of the <b><a href="qtmultimedia-module.html">QtMultimedia</a> 5.0</b> module.</p>
<p>This type allows you to play uncompressed audio files (typically WAV files) in a generally lower latency way, and is suitable for &quot;feedback&quot; type sounds in response to user actions (e.g&#x2e; virtual keyboard sounds, positive or negative feedback for popup dialogs, or game sounds). If low latency is not important, consider using the <a href="qml-qtmultimedia-mediaplayer.html">MediaPlayer</a> or Audio types instead, since they support a wider variety of media formats and are less resource intensive.</p>
<p>Typically the sound effect should be reused, which allows all the parsing and preparation to be done ahead of time, and only triggered when necessary. This is easy to achieve with QML, since you can declare your SoundEffect instance and refer to it elsewhere.</p>
<p>The following example plays a WAV file on mouse click.</p>
<pre class="qml">import QtQuick 2.0
import QtMultimedia 5.0

<span class="type">Text</span> {
    <span class="name">text</span>: <span class="string">&quot;Click Me!&quot;</span>;
    <span class="name">font</span>.pointSize: <span class="number">24</span>;
    <span class="name">width</span>: <span class="number">150</span>; <span class="name">height</span>: <span class="number">50</span>;

    <span class="type">SoundEffect</span> {
        <span class="name">id</span>: <span class="name">playSound</span>
        <span class="name">source</span>: <span class="string">&quot;soundeffect.wav&quot;</span>
    }
    <span class="type">MouseArea</span> {
        <span class="name">id</span>: <span class="name">playArea</span>
        <span class="name">anchors</span>.fill: <span class="name">parent</span>
        <span class="name">onPressed</span>: { <span class="name">playSound</span>.<span class="name">play</span>() }
    }
}</pre>
<p>Since SoundEffect requires slightly more resources to achieve lower latency playback, the platform may limit the number of simultaneously playing sound effects.</p>
<!-- @@@SoundEffect -->
<h2>Property Documentation</h2>
<!-- $$$category -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="category-prop"></a><span class="name">category</span> : <span class="type">string</span></p></td></tr></table></div><div class="qmldoc"><p>This property contains the <i>category</i> of this sound effect.</p>
<p>Some platforms can perform different audio routing for different categories, or may allow the user to set different volume levels for different categories.</p>
<p>This setting will be ignored on platforms that do not support audio categories.</p>
</div></div><!-- @@@category -->
<br/>
<!-- $$$loops -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="loops-prop"></a><span class="name">loops</span> : <span class="type">int</span></p></td></tr></table></div><div class="qmldoc"><p>This property provides a way to control the number of times to repeat the sound on each <a href="qml-qtmultimedia-soundeffect.html#play-method">play()</a>.</p>
<p>Set to <a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a>.Infinite to enable infinite looping.</p>
</div></div><!-- @@@loops -->
<br/>
<!-- $$$loopsRemaining -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="loopsRemaining-prop"></a><span class="name">loopsRemaining</span> : <span class="type">int</span></p></td></tr></table></div><div class="qmldoc"><p>This property contains the number of loops remaining before the sound effect stops by itself, or <a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a>.Infinite if that's what has been set in <a href="qml-qtmultimedia-soundeffect.html#loops-prop">loops</a>.</p>
</div></div><!-- @@@loopsRemaining -->
<br/>
<!-- $$$muted -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="muted-prop"></a><span class="name">muted</span> : <span class="type">bool</span></p></td></tr></table></div><div class="qmldoc"><p>This property provides a way to control muting. A value of <tt>true</tt> will mute this effect. Otherwise, playback will occur with the currently specified <a href="qml-qtmultimedia-soundeffect.html#volume-prop">volume</a>.</p>
</div></div><!-- @@@muted -->
<br/>
<!-- $$$playing -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="playing-prop"></a><span class="name">playing</span> : <span class="type">bool</span></p></td></tr></table></div><div class="qmldoc"><p>This property indicates whether the sound effect is playing or not.</p>
</div></div><!-- @@@playing -->
<br/>
<!-- $$$source -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="source-prop"></a><span class="name">source</span> : <span class="type">url</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the url for the sound to play. For the <a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a> to attempt to load the source, the URL must exist and the application must have read permission in the specified directory. If the desired source is a local file the URL may be specified using either absolute or relative (to the file that declared the <a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a>) pathing.</p>
</div></div><!-- @@@source -->
<br/>
<!-- $$$status -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="status-prop"></a><span class="name">status</span> : <span class="type">enumeration</span></p></td></tr></table></div><div class="qmldoc"><p>This property indicates the current status of the <a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a> as enumerated within <a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a>. Possible statuses are listed below.</p>
<table class="generic">
 <thead><tr class="qt-style"><th >Value</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a>.Null</td><td >No source has been set or the source is null.</td></tr>
<tr valign="top" class="even"><td ><a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a>.Loading</td><td >The <a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a> is trying to load the source.</td></tr>
<tr valign="top" class="odd"><td ><a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a>.Ready</td><td >The source is loaded and ready for play.</td></tr>
<tr valign="top" class="even"><td ><a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a>.Error</td><td >An error occurred during operation, such as failure of loading the source.</td></tr>
</table>
</div></div><!-- @@@status -->
<br/>
<!-- $$$volume -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="volume-prop"></a><span class="name">volume</span> : <span class="type">qreal</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the volume of the sound effect playback, from 0.0 (silent) to 1.0 (maximum volume).</p>
</div></div><!-- @@@volume -->
<br/>
<h2>Signal Documentation</h2>
<!-- $$$categoryChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="categoryChanged-signal"></a><span class="name">categoryChanged</span>()</p></td></tr></table></div><div class="qmldoc"><p>The <tt>categoryChanged</tt> signal is emitted when the category property has changed.</p>
<p>The corresponding handler is <tt>onCategoryChanged</tt>.</p>
</div></div><!-- @@@categoryChanged -->
<br/>
<!-- $$$loadedChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="loadedChanged-signal"></a><span class="name">loadedChanged</span>()</p></td></tr></table></div><div class="qmldoc"><p>The <tt>loadedChanged</tt> signal is emitted when the loading state has changed.</p>
<p>The corresponding handler is <tt>onLoadedChanged</tt>.</p>
</div></div><!-- @@@loadedChanged -->
<br/>
<!-- $$$loopCountChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="loopCountChanged-signal"></a><span class="name">loopCountChanged</span>()</p></td></tr></table></div><div class="qmldoc"><p>The <tt>loopCountChanged</tt> signal is emitted when the initial number of loops has changed.</p>
<p>The corresponding handler is <tt>onLoopCountChanged</tt>.</p>
</div></div><!-- @@@loopCountChanged -->
<br/>
<!-- $$$loopsRemainingChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="loopsRemainingChanged-signal"></a><span class="name">loopsRemainingChanged</span>()</p></td></tr></table></div><div class="qmldoc"><p>The <tt>loopsRemainingChanged</tt> signal is emitted when the remaining number of loops has changed.</p>
<p>The corresponding handler is <tt>onLoopsRemainingChanged</tt>.</p>
</div></div><!-- @@@loopsRemainingChanged -->
<br/>
<!-- $$$mutedChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="mutedChanged-signal"></a><span class="name">mutedChanged</span>()</p></td></tr></table></div><div class="qmldoc"><p>The <tt>mutedChanged</tt> signal is emitted when the mute state has changed.</p>
<p>The corresponding handler is <tt>onMutedChanged</tt>.</p>
</div></div><!-- @@@mutedChanged -->
<br/>
<!-- $$$playingChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="playingChanged-signal"></a><span class="name">playingChanged</span>()</p></td></tr></table></div><div class="qmldoc"><p>The <tt>playingChanged</tt> signal is emitted when the playing property has changed.</p>
<p>The corresponding handler is <tt>onPlayingChanged</tt>.</p>
</div></div><!-- @@@playingChanged -->
<br/>
<!-- $$$sourceChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="sourceChanged-signal"></a><span class="name">sourceChanged</span>()</p></td></tr></table></div><div class="qmldoc"><p>The <tt>sourceChanged</tt> signal is emitted when the source has been changed.</p>
<p>The corresponding handler is <tt>onSourceChanged</tt>.</p>
</div></div><!-- @@@sourceChanged -->
<br/>
<!-- $$$statusChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="statusChanged-signal"></a><span class="name">statusChanged</span>()</p></td></tr></table></div><div class="qmldoc"><p>The <tt>statusChanged</tt> signal is emitted when the status property has changed.</p>
<p>The corresponding handler is <tt>onStatusChanged</tt>.</p>
</div></div><!-- @@@statusChanged -->
<br/>
<!-- $$$volumeChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="volumeChanged-signal"></a><span class="name">volumeChanged</span>()</p></td></tr></table></div><div class="qmldoc"><p>The <tt>volumeChanged</tt> signal is emitted when the volume has changed.</p>
<p>The corresponding handler is <tt>onVolumeChanged</tt>.</p>
</div></div><!-- @@@volumeChanged -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$isLoaded -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="isLoaded-method"></a><span class="type">bool</span> <span class="name">isLoaded</span>()</p></td></tr></table></div><div class="qmldoc"><p>Returns whether the sound effect has finished loading the <a href="qml-qtmultimedia-soundeffect.html#source-prop">source</a>.</p>
</div></div><!-- @@@isLoaded -->
<br/>
<!-- $$$play -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="play-method"></a><span class="name">play</span>()</p></td></tr></table></div><div class="qmldoc"><p>Start playback of the sound effect, looping the effect for the number of times as specified in the loops property.</p>
<p>This is the default method for <a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a>.</p>
<pre class="qml"><span class="type"><a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a></span> {
    <span class="name">id</span>: <span class="name">playSound</span>
    <span class="name">source</span>: <span class="string">&quot;soundeffect.wav&quot;</span>
}
<span class="type">MouseArea</span> {
    <span class="name">id</span>: <span class="name">playArea</span>
    <span class="name">anchors</span>.fill: <span class="name">parent</span>
    <span class="name">onPressed</span>: { <span class="name">playSound</span>.<span class="name">play</span>() }
}</pre>
</div></div><!-- @@@play -->
<br/>
<!-- $$$stop -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="stop-method"></a><span class="name">stop</span>()</p></td></tr></table></div><div class="qmldoc"><p>Stop current playback.</p>
</div></div><!-- @@@stop -->
<br/>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
   subsidiaries. Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Digia, Qt and their respective logos are trademarks of Digia Plc     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>