Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 9ee5ef51dbf4a00567f58cff4d0e160c > files > 301

qtmultimedia5-doc-5.9.4-1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qsoundeffect.cpp -->
  <title>QSoundEffect Class | Qt Multimedia 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtmultimedia-index.html">Qt Multimedia</a></td><td ><a href="qtmultimedia-modules.html">C++ Classes</a></td><td >QSoundEffect</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QSoundEffect Class</h1>
<!-- $$$QSoundEffect-brief -->
<p>The <a href="qsoundeffect.html">QSoundEffect</a> class provides a way to play low latency sound effects. <a href="#details">More...</a></p>
<!-- @@@QSoundEffect -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QSoundEffect&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += multimedia</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Instantiated By:</td><td class="memItemRight bottomAlign"> <a href="qml-qtmultimedia-soundeffect.html">SoundEffect</a></td></tr></table></div><ul>
<li><a href="qsoundeffect-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#Loop-enum">Loop</a></b> { Infinite }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#Status-enum">Status</a></b> { Null, Loading, Ready, Error }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qsoundeffect.html#category-prop">category</a></b> : QString</li>
<li class="fn"><b><a href="qsoundeffect.html#loops-prop">loops</a></b> : int</li>
<li class="fn"><b><a href="qsoundeffect.html#loopsRemaining-prop">loopsRemaining</a></b> : const int</li>
<li class="fn"><b><a href="qsoundeffect.html#muted-prop">muted</a></b> : bool</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qsoundeffect.html#playing-prop">playing</a></b> : const bool</li>
<li class="fn"><b><a href="qsoundeffect.html#source-prop">source</a></b> : QUrl</li>
<li class="fn"><b><a href="qsoundeffect.html#status-prop">status</a></b> : const Status</li>
<li class="fn"><b><a href="qsoundeffect.html#volume-prop">volume</a></b> : qreal</li>
</ul>
</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#QSoundEffect">QSoundEffect</a></b>(QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#dtor.QSoundEffect">~QSoundEffect</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#category">category</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#isLoaded">isLoaded</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#isMuted">isMuted</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#isPlaying">isPlaying</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#loopCount">loopCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#loopsRemaining-prop">loopsRemaining</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#setCategory">setCategory</a></b>(const QString &amp;<i>category</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#setLoopCount">setLoopCount</a></b>(int <i>loopCount</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#setMuted">setMuted</a></b>(bool <i>muted</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#setSource">setSource</a></b>(const QUrl &amp;<i>url</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#setVolume">setVolume</a></b>(qreal <i>volume</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#source">source</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Status </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#status">status</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#volume">volume</a></b>() const</td></tr>
</table></div>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#play">play</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#stop">stop</a></b>()</td></tr>
</table></div>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#categoryChanged">categoryChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#loadedChanged">loadedChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#loopCountChanged">loopCountChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#loopsRemainingChanged">loopsRemainingChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#mutedChanged">mutedChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#playingChanged">playingChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#sourceChanged">sourceChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#statusChanged">statusChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#volumeChanged">volumeChanged</a></b>()</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qsoundeffect.html#supportedMimeTypes">supportedMimeTypes</a></b>()</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QSoundEffect-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qsoundeffect.html">QSoundEffect</a> class provides a way to play low latency sound effects.</p>
<p>This class 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="qmediaplayer.html">QMediaPlayer</a> class instead, since it supports a wider variety of media formats and is less resource intensive.</p>
<p>This example shows how a looping, somewhat quiet sound effect can be played:</p>
<pre class="cpp">

  <span class="type"><a href="qsoundeffect.html#QSoundEffect">QSoundEffect</a></span> effect;
  effect<span class="operator">.</span>setSource(<span class="type">QUrl</span><span class="operator">::</span>fromLocalFile(<span class="string">&quot;engine.wav&quot;</span>));
  effect<span class="operator">.</span>setLoopCount(<span class="type"><a href="qsoundeffect.html#QSoundEffect">QSoundEffect</a></span><span class="operator">::</span>Infinite);
  effect<span class="operator">.</span>setVolume(<span class="number">0.25f</span>);
  effect<span class="operator">.</span>play();

</pre>
<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 assists with lower latency audio playback.</p>
<pre class="cpp">

  MyGame()
      : m_explosion(<span class="keyword">this</span>)
  {
      m_explosion<span class="operator">.</span>setSource(<span class="type">QUrl</span><span class="operator">::</span>fromLocalFile(<span class="string">&quot;explosion.wav&quot;</span>));
      m_explosion<span class="operator">.</span>setVolume(<span class="number">0.25f</span>);

      <span class="comment">// Set up click handling etc.</span>
      connect(clickSource<span class="operator">,</span> SIGNAL(clicked())<span class="operator">,</span> <span class="operator">&amp;</span>m_explosion<span class="operator">,</span> SLOT(play()));
  }
  <span class="keyword">private</span>:
  <span class="type"><a href="qsoundeffect.html#QSoundEffect">QSoundEffect</a></span> m_explosion;

</pre>
<p>Since <a href="qsoundeffect.html">QSoundEffect</a> requires slightly more resources to achieve lower latency playback, the platform may limit the number of simultaneously playing sound effects.</p>
</div>
<!-- @@@QSoundEffect -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Loop$$$Infinite -->
<h3 class="fn" id="Loop-enum"><a name="Loop-enum"></a>enum QSoundEffect::<span class="name">Loop</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QSoundEffect::Infinite</code></td><td class="topAlign tblval"><code>-2</code></td><td class="topAlign">Used as a parameter to <a href="qsoundeffect.html#setLoopCount">setLoopCount</a>() for infinite looping</td></tr>
</table></div>
<!-- @@@Loop -->
<!-- $$$Status$$$Null$$$Loading$$$Ready$$$Error -->
<h3 class="fn" id="Status-enum"><a name="Status-enum"></a>enum QSoundEffect::<span class="name">Status</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QSoundEffect::Null</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">No source has been set or the source is null.</td></tr>
<tr><td class="topAlign"><code>QSoundEffect::Loading</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The <a href="qml-multimedia.html#soundeffect">SoundEffect</a> is trying to load the source.</td></tr>
<tr><td class="topAlign"><code>QSoundEffect::Ready</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The source is loaded and ready for play.</td></tr>
<tr><td class="topAlign"><code>QSoundEffect::Error</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">An error occurred during operation, such as failure of loading the source.</td></tr>
</table></div>
<!-- @@@Status -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$category-prop$$$category$$$setCategoryconstQString&$$$categoryChanged -->
<h3 class="fn" id="category-prop"><a name="category-prop"></a><span class="name">category</span> : <span class="type">QString</span></h3>
<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>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#category">category</a></b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#setCategory">setCategory</a></b></span>(const QString &amp;<i>category</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#categoryChanged">categoryChanged</a></b></span>()</td></tr>
</table></div>
<!-- @@@category -->
<!-- $$$loops-prop$$$loopCount$$$setLoopCountint$$$loopCountChanged -->
<h3 class="fn" id="loops-prop"><a name="loops-prop"></a><span class="name">loops</span> : <span class="type">int</span></h3>
<p>This property holds the number of times the sound is played. A value of 0 or 1 means the sound will be played only once; set to <a href="qml-multimedia.html#soundeffect">SoundEffect</a>.Infinite to enable infinite looping.</p>
<p>The value can be changed while the sound effect is playing, in which case it will update the remaining loops to the new value.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#loopCount">loopCount</a></b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#setLoopCount">setLoopCount</a></b></span>(int <i>loopCount</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#loopCountChanged">loopCountChanged</a></b></span>()</td></tr>
</table></div>
<!-- @@@loops -->
<!-- $$$loopsRemaining-prop$$$loopsRemaining$$$loopsRemainingChanged -->
<h3 class="fn" id="loopsRemaining-prop"><a name="loopsRemaining-prop"></a><span class="name">loopsRemaining</span> : const <span class="type">int</span></h3>
<p>This property contains the number of loops remaining before the sound effect stops by itself, or <a href="qsoundeffect.html#Loop-enum">QSoundEffect::Infinite</a> if that's what has been set in <a href="qsoundeffect.html#loops-prop">loops</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>loopsRemaining</b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#loopsRemainingChanged">loopsRemainingChanged</a></b></span>()</td></tr>
</table></div>
<!-- @@@loopsRemaining -->
<!-- $$$muted-prop$$$isMuted$$$setMutedbool$$$mutedChanged -->
<h3 class="fn" id="muted-prop"><a name="muted-prop"></a><span class="name">muted</span> : <span class="type">bool</span></h3>
<p>This property provides a way to control muting. A value of <code>true</code> will mute this effect.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#isMuted">isMuted</a></b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#setMuted">setMuted</a></b></span>(bool <i>muted</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#mutedChanged">mutedChanged</a></b></span>()</td></tr>
</table></div>
<!-- @@@muted -->
<!-- $$$playing-prop$$$isPlaying$$$playingChanged -->
<h3 class="fn" id="playing-prop"><a name="playing-prop"></a><span class="name">playing</span> : const <span class="type">bool</span></h3>
<p>This property indicates whether the sound effect is playing or not.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#isPlaying">isPlaying</a></b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#playingChanged">playingChanged</a></b></span>()</td></tr>
</table></div>
<!-- @@@playing -->
<!-- $$$source-prop$$$source$$$setSourceconstQUrl&$$$sourceChanged -->
<h3 class="fn" id="source-prop"><a name="source-prop"></a><span class="name">source</span> : <span class="type">QUrl</span></h3>
<p>This property holds the url for the sound to play. For the <a href="qml-multimedia.html#soundeffect">SoundEffect</a> to attempt to load the source, the URL must exist and the application must have read permission in the specified directory.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QUrl </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#source">source</a></b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#setSource">setSource</a></b></span>(const QUrl &amp;<i>url</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#sourceChanged">sourceChanged</a></b></span>()</td></tr>
</table></div>
<!-- @@@source -->
<!-- $$$status-prop$$$status$$$statusChanged -->
<h3 class="fn" id="status-prop"><a name="status-prop"></a><span class="name">status</span> : const <span class="type"><a href="qsoundeffect.html#Status-enum">Status</a></span></h3>
<p>This property indicates the current status of the sound effect from the <a href="qsoundeffect.html#Status-enum">QSoundEffect::Status</a> enumeration.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Status </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#status">status</a></b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#statusChanged">statusChanged</a></b></span>()</td></tr>
</table></div>
<!-- @@@status -->
<!-- $$$volume-prop$$$volume$$$setVolumeqreal$$$volumeChanged -->
<h3 class="fn" id="volume-prop"><a name="volume-prop"></a><span class="name">volume</span> : <span class="type">qreal</span></h3>
<p>This property holds the volume of the sound effect playback, from 0.0 (silence) to 1.0 (full volume).</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#volume">volume</a></b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#setVolume">setVolume</a></b></span>(qreal <i>volume</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qsoundeffect.html#volumeChanged">volumeChanged</a></b></span>()</td></tr>
</table></div>
<!-- @@@volume -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QSoundEffect[overload1]$$$QSoundEffectQObject* -->
<h3 class="fn" id="QSoundEffect"><a name="QSoundEffect"></a>QSoundEffect::<span class="name">QSoundEffect</span>(<span class="type">QObject</span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Creates a <a href="qsoundeffect.html">QSoundEffect</a> with the given <i>parent</i>.</p>
<!-- @@@QSoundEffect -->
<!-- $$$~QSoundEffect[overload1]$$$~QSoundEffect -->
<h3 class="fn" id="dtor.QSoundEffect"><a name="dtor.QSoundEffect"></a>QSoundEffect::<span class="name">~QSoundEffect</span>()</h3>
<p>Destroys this sound effect.</p>
<!-- @@@~QSoundEffect -->
<!-- $$$category -->
<h3 class="fn" id="category"><a name="category"></a><span class="type">QString</span> QSoundEffect::<span class="name">category</span>() const</h3>
<p>Returns the current <i>category</i> for 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>
<p><b>Note:</b> Getter function for property <a href="qsoundeffect.html#category-prop">category</a>. </p><p><b>See also </b><a href="qsoundeffect.html#setCategory">setCategory</a>().</p>
<!-- @@@category -->
<!-- $$$categoryChanged -->
<h3 class="fn" id="categoryChanged"><a name="categoryChanged"></a><code>[signal] </code><span class="type">void</span> QSoundEffect::<span class="name">categoryChanged</span>()</h3>
<p>The <code>categoryChanged</code> signal is emitted when the category property has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qsoundeffect.html#category-prop">category</a>. </p><!-- @@@categoryChanged -->
<!-- $$$isLoaded[overload1]$$$isLoaded -->
<h3 class="fn" id="isLoaded"><a name="isLoaded"></a><span class="type">bool</span> QSoundEffect::<span class="name">isLoaded</span>() const</h3>
<p>Returns whether the sound effect has finished loading the <a href="qsoundeffect.html#source">source</a>().</p>
<!-- @@@isLoaded -->
<!-- $$$isMuted -->
<h3 class="fn" id="isMuted"><a name="isMuted"></a><span class="type">bool</span> QSoundEffect::<span class="name">isMuted</span>() const</h3>
<p>Returns whether this sound effect is muted</p>
<p><b>Note:</b> Getter function for property <a href="qsoundeffect.html#muted-prop">muted</a>. </p><!-- @@@isMuted -->
<!-- $$$isPlaying -->
<h3 class="fn" id="isPlaying"><a name="isPlaying"></a><span class="type">bool</span> QSoundEffect::<span class="name">isPlaying</span>() const</h3>
<p>Returns true if the sound effect is currently playing, or false otherwise</p>
<p><b>Note:</b> Getter function for property <a href="qsoundeffect.html#playing-prop">playing</a>. </p><!-- @@@isPlaying -->
<!-- $$$loadedChanged[overload1]$$$loadedChanged -->
<h3 class="fn" id="loadedChanged"><a name="loadedChanged"></a><code>[signal] </code><span class="type">void</span> QSoundEffect::<span class="name">loadedChanged</span>()</h3>
<p>The <code>loadedChanged</code> signal is emitted when the loading state has changed.</p>
<!-- @@@loadedChanged -->
<!-- $$$loopCount -->
<h3 class="fn" id="loopCount"><a name="loopCount"></a><span class="type">int</span> QSoundEffect::<span class="name">loopCount</span>() const</h3>
<p>Returns the total number of times that this sound effect will be played before stopping.</p>
<p>See the <a href="qsoundeffect.html#loopsRemaining-prop">loopsRemaining</a>() method for the number of loops currently remaining.</p>
<p><b>Note:</b> Getter function for property <a href="qsoundeffect.html#loops-prop">loops</a>. </p><p><b>See also </b><a href="qsoundeffect.html#setLoopCount">setLoopCount</a>().</p>
<!-- @@@loopCount -->
<!-- $$$loopCountChanged -->
<h3 class="fn" id="loopCountChanged"><a name="loopCountChanged"></a><code>[signal] </code><span class="type">void</span> QSoundEffect::<span class="name">loopCountChanged</span>()</h3>
<p>The <code>loopCountChanged</code> signal is emitted when the initial number of loops has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qsoundeffect.html#loops-prop">loops</a>. </p><!-- @@@loopCountChanged -->
<!-- $$$loopsRemainingChanged -->
<h3 class="fn" id="loopsRemainingChanged"><a name="loopsRemainingChanged"></a><code>[signal] </code><span class="type">void</span> QSoundEffect::<span class="name">loopsRemainingChanged</span>()</h3>
<p>The <code>loopsRemainingChanged</code> signal is emitted when the remaining number of loops has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qsoundeffect.html#loopsRemaining-prop">loopsRemaining</a>. </p><!-- @@@loopsRemainingChanged -->
<!-- $$$mutedChanged -->
<h3 class="fn" id="mutedChanged"><a name="mutedChanged"></a><code>[signal] </code><span class="type">void</span> QSoundEffect::<span class="name">mutedChanged</span>()</h3>
<p>The <code>mutedChanged</code> signal is emitted when the mute state has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qsoundeffect.html#muted-prop">muted</a>. </p><!-- @@@mutedChanged -->
<!-- $$$play[overload1]$$$play -->
<h3 class="fn" id="play"><a name="play"></a><code>[slot] </code><span class="type">void</span> QSoundEffect::<span class="name">play</span>()</h3>
<p>Start playback of the sound effect, looping the effect for the number of times as specified in the loops property.</p>
<!-- @@@play -->
<!-- $$$playingChanged -->
<h3 class="fn" id="playingChanged"><a name="playingChanged"></a><code>[signal] </code><span class="type">void</span> QSoundEffect::<span class="name">playingChanged</span>()</h3>
<p>The <code>playingChanged</code> signal is emitted when the playing property has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qsoundeffect.html#playing-prop">playing</a>. </p><!-- @@@playingChanged -->
<!-- $$$setCategory -->
<h3 class="fn" id="setCategory"><a name="setCategory"></a><span class="type">void</span> QSoundEffect::<span class="name">setCategory</span>(const <span class="type">QString</span> &amp;<i>category</i>)</h3>
<p>Sets the <i>category</i> of this sound effect to <i>category</i>.</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>
<p>If this setting is changed while a sound effect is playing it will only take effect when the sound effect has stopped playing.</p>
<p><b>Note:</b> Setter function for property <a href="qsoundeffect.html#category-prop">category</a>. </p><p><b>See also </b><a href="qsoundeffect.html#category">category</a>().</p>
<!-- @@@setCategory -->
<!-- $$$setLoopCount -->
<h3 class="fn" id="setLoopCount"><a name="setLoopCount"></a><span class="type">void</span> QSoundEffect::<span class="name">setLoopCount</span>(<span class="type">int</span> <i>loopCount</i>)</h3>
<p>Set the total number of times to play this sound effect to <i>loopCount</i>.</p>
<p>Setting the loop count to 0 or 1 means the sound effect will be played only once; pass <code>QSoundEffect::Infinite</code> to repeat indefinitely. The loop count can be changed while the sound effect is playing, in which case it will update the remaining loops to the new <i>loopCount</i>.</p>
<p><b>Note:</b> Setter function for property <a href="qsoundeffect.html#loops-prop">loops</a>. </p><p><b>See also </b><a href="qsoundeffect.html#loopCount">loopCount</a>() and <a href="qsoundeffect.html#loopsRemaining-prop">loopsRemaining</a>().</p>
<!-- @@@setLoopCount -->
<!-- $$$setMuted -->
<h3 class="fn" id="setMuted"><a name="setMuted"></a><span class="type">void</span> QSoundEffect::<span class="name">setMuted</span>(<span class="type">bool</span> <i>muted</i>)</h3>
<p>Sets whether to mute this sound effect's playback.</p>
<p>If <i>muted</i> is true, playback will be muted (silenced), and otherwise playback will occur with the currently specified <a href="qsoundeffect.html#volume">volume</a>().</p>
<p><b>Note:</b> Setter function for property <a href="qsoundeffect.html#muted-prop">muted</a>. </p><p><b>See also </b><a href="qsoundeffect.html#isMuted">isMuted</a>().</p>
<!-- @@@setMuted -->
<!-- $$$setSource -->
<h3 class="fn" id="setSource"><a name="setSource"></a><span class="type">void</span> QSoundEffect::<span class="name">setSource</span>(const <span class="type">QUrl</span> &amp;<i>url</i>)</h3>
<p>Set the current URL to play to <i>url</i>.</p>
<p><b>Note:</b> Setter function for property <a href="qsoundeffect.html#source-prop">source</a>. </p><p><b>See also </b><a href="qsoundeffect.html#source">source</a>().</p>
<!-- @@@setSource -->
<!-- $$$setVolume -->
<h3 class="fn" id="setVolume"><a name="setVolume"></a><span class="type">void</span> QSoundEffect::<span class="name">setVolume</span>(<span class="type">qreal</span> <i>volume</i>)</h3>
<p>Sets the sound effect volume to <i>volume</i>.</p>
<p>The volume is scaled linearly from <code>0.0</code> (silence) to <code>1.0</code> (full volume). Values outside this range will be clamped.</p>
<p>The default volume is <code>1.0</code>.</p>
<p>UI volume controls should usually be scaled nonlinearly. For example, using a logarithmic scale will produce linear changes in perceived loudness, which is what a user would normally expect from a volume control. See <a href="qaudio.html#convertVolume">QAudio::convertVolume</a>() for more details.</p>
<p><b>Note:</b> Setter function for property <a href="qsoundeffect.html#volume-prop">volume</a>. </p><p><b>See also </b><a href="qsoundeffect.html#volume">volume</a>().</p>
<!-- @@@setVolume -->
<!-- $$$source -->
<h3 class="fn" id="source"><a name="source"></a><span class="type">QUrl</span> QSoundEffect::<span class="name">source</span>() const</h3>
<p>Returns the URL of the current source to play</p>
<p><b>Note:</b> Getter function for property <a href="qsoundeffect.html#source-prop">source</a>. </p><p><b>See also </b><a href="qsoundeffect.html#setSource">setSource</a>().</p>
<!-- @@@source -->
<!-- $$$sourceChanged -->
<h3 class="fn" id="sourceChanged"><a name="sourceChanged"></a><code>[signal] </code><span class="type">void</span> QSoundEffect::<span class="name">sourceChanged</span>()</h3>
<p>The <code>sourceChanged</code> signal is emitted when the source has been changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qsoundeffect.html#source-prop">source</a>. </p><!-- @@@sourceChanged -->
<!-- $$$status -->
<h3 class="fn" id="status"><a name="status"></a><span class="type"><a href="qsoundeffect.html#Status-enum">Status</a></span> QSoundEffect::<span class="name">status</span>() const</h3>
<p>Returns the current status of this sound effect.</p>
<p><b>Note:</b> Getter function for property <a href="qsoundeffect.html#status-prop">status</a>. </p><!-- @@@status -->
<!-- $$$statusChanged -->
<h3 class="fn" id="statusChanged"><a name="statusChanged"></a><code>[signal] </code><span class="type">void</span> QSoundEffect::<span class="name">statusChanged</span>()</h3>
<p>The <code>statusChanged</code> signal is emitted when the status property has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qsoundeffect.html#status-prop">status</a>. </p><!-- @@@statusChanged -->
<!-- $$$stop[overload1]$$$stop -->
<h3 class="fn" id="stop"><a name="stop"></a><code>[slot] </code><span class="type">void</span> QSoundEffect::<span class="name">stop</span>()</h3>
<p>Stop current playback.</p>
<!-- @@@stop -->
<!-- $$$supportedMimeTypes[overload1]$$$supportedMimeTypes -->
<h3 class="fn" id="supportedMimeTypes"><a name="supportedMimeTypes"></a><code>[static] </code><span class="type">QStringList</span> QSoundEffect::<span class="name">supportedMimeTypes</span>()</h3>
<p>Returns a list of the supported mime types for this platform.</p>
<!-- @@@supportedMimeTypes -->
<!-- $$$volume -->
<h3 class="fn" id="volume"><a name="volume"></a><span class="type">qreal</span> QSoundEffect::<span class="name">volume</span>() const</h3>
<p>Returns the current volume of this sound effect, from 0.0 (silent) to 1.0 (maximum volume).</p>
<p><b>Note:</b> Getter function for property <a href="qsoundeffect.html#volume-prop">volume</a>. </p><p><b>See also </b><a href="qsoundeffect.html#setVolume">setVolume</a>().</p>
<!-- @@@volume -->
<!-- $$$volumeChanged -->
<h3 class="fn" id="volumeChanged"><a name="volumeChanged"></a><code>[signal] </code><span class="type">void</span> QSoundEffect::<span class="name">volumeChanged</span>()</h3>
<p>The <code>volumeChanged</code> signal is emitted when the volume has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qsoundeffect.html#volume-prop">volume</a>. </p><!-- @@@volumeChanged -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   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>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>