shooter/SFML-mingw32/doc/html/classsf_1_1Music.html

1446 lines
85 KiB
HTML

<!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">
<head>
<title>SFML - Simple and Fast Multimedia Library</title>
<meta http-equiv="Content-Type" content="text/html;"/>
<meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">SFML 2.5.1</span>
</div>
</div>
<div id="content">
<!-- Generated by Doxygen 1.8.14 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Music.html">Music</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classsf_1_1Music-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">sf::Music Class Reference<div class="ingroups"><a class="el" href="group__audio.html">Audio module</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>Streamed music played from an audio file.
<a href="classsf_1_1Music.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Music_8hpp_source.html">Music.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for sf::Music:</div>
<div class="dyncontent">
<div class="center">
<img src="classsf_1_1Music.png" usemap="#sf::Music_map" alt=""/>
<map id="sf::Music_map" name="sf::Music_map">
<area href="classsf_1_1SoundStream.html" title="Abstract base class for streamed audio sources. " alt="sf::SoundStream" shape="rect" coords="0,112,105,136"/>
<area href="classsf_1_1SoundSource.html" title="Base class defining a sound&#39;s properties. " alt="sf::SoundSource" shape="rect" coords="0,56,105,80"/>
<area href="classsf_1_1AlResource.html" title="Base class for classes that require an OpenAL context. " alt="sf::AlResource" shape="rect" coords="0,0,105,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsf_1_1Music_1_1Span.html">Span</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure defining a time range using the template type. <a href="structsf_1_1Music_1_1Span.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a87625c59543125c81c380aa37aeb93e7"><td class="memItemLeft" align="right" valign="top"><a id="a87625c59543125c81c380aa37aeb93e7"></a>
typedef <a class="el" href="structsf_1_1Music_1_1Span.html">Span</a>&lt; <a class="el" href="classsf_1_1Time.html">Time</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>TimeSpan</b></td></tr>
<tr class="separator:a87625c59543125c81c380aa37aeb93e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac43af72c98c077500b239bc75b812f03"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#ac43af72c98c077500b239bc75b812f03">Status</a> { <a class="el" href="classsf_1_1SoundSource.html#ac43af72c98c077500b239bc75b812f03adabb01e8aa85b2f54b344890addf764a">Stopped</a>,
<a class="el" href="classsf_1_1SoundSource.html#ac43af72c98c077500b239bc75b812f03ac3ca1fcc0394267c9bdbe3dc0a8a7e41">Paused</a>,
<a class="el" href="classsf_1_1SoundSource.html#ac43af72c98c077500b239bc75b812f03af07bdea9f70ef7606dfc9f955beeee18">Playing</a>
}</td></tr>
<tr class="memdesc:ac43af72c98c077500b239bc75b812f03"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration of the sound source states. <a href="classsf_1_1SoundSource.html#ac43af72c98c077500b239bc75b812f03">More...</a><br /></td></tr>
<tr class="separator:ac43af72c98c077500b239bc75b812f03"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0bc787d8e022b3a9b89cf2c28befd42e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#a0bc787d8e022b3a9b89cf2c28befd42e">Music</a> ()</td></tr>
<tr class="memdesc:a0bc787d8e022b3a9b89cf2c28befd42e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#a0bc787d8e022b3a9b89cf2c28befd42e">More...</a><br /></td></tr>
<tr class="separator:a0bc787d8e022b3a9b89cf2c28befd42e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c65860fed2f01d0eaa6c4199870414b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#a4c65860fed2f01d0eaa6c4199870414b">~Music</a> ()</td></tr>
<tr class="memdesc:a4c65860fed2f01d0eaa6c4199870414b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a4c65860fed2f01d0eaa6c4199870414b">More...</a><br /></td></tr>
<tr class="separator:a4c65860fed2f01d0eaa6c4199870414b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3edc66e5f5b3f11e84b90eaec9c7d7c0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#a3edc66e5f5b3f11e84b90eaec9c7d7c0">openFromFile</a> (const std::string &amp;filename)</td></tr>
<tr class="memdesc:a3edc66e5f5b3f11e84b90eaec9c7d7c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Open a music from an audio file. <a href="#a3edc66e5f5b3f11e84b90eaec9c7d7c0">More...</a><br /></td></tr>
<tr class="separator:a3edc66e5f5b3f11e84b90eaec9c7d7c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae93b21bcf28ff0b5fec458039111386e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#ae93b21bcf28ff0b5fec458039111386e">openFromMemory</a> (const void *data, std::size_t sizeInBytes)</td></tr>
<tr class="memdesc:ae93b21bcf28ff0b5fec458039111386e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Open a music from an audio file in memory. <a href="#ae93b21bcf28ff0b5fec458039111386e">More...</a><br /></td></tr>
<tr class="separator:ae93b21bcf28ff0b5fec458039111386e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e55d1910a26858b44778c26b237d673"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#a4e55d1910a26858b44778c26b237d673">openFromStream</a> (<a class="el" href="classsf_1_1InputStream.html">InputStream</a> &amp;stream)</td></tr>
<tr class="memdesc:a4e55d1910a26858b44778c26b237d673"><td class="mdescLeft">&#160;</td><td class="mdescRight">Open a music from an audio file in a custom stream. <a href="#a4e55d1910a26858b44778c26b237d673">More...</a><br /></td></tr>
<tr class="separator:a4e55d1910a26858b44778c26b237d673"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a288ef6f552a136b0e56952dcada3d672"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Time.html">Time</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#a288ef6f552a136b0e56952dcada3d672">getDuration</a> () const</td></tr>
<tr class="memdesc:a288ef6f552a136b0e56952dcada3d672"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the total duration of the music. <a href="#a288ef6f552a136b0e56952dcada3d672">More...</a><br /></td></tr>
<tr class="separator:a288ef6f552a136b0e56952dcada3d672"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae3451cad5c16ee6a6e124e62ed61361"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structsf_1_1Music_1_1Span.html">TimeSpan</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#aae3451cad5c16ee6a6e124e62ed61361">getLoopPoints</a> () const</td></tr>
<tr class="memdesc:aae3451cad5c16ee6a6e124e62ed61361"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the positions of the of the sound's looping sequence. <a href="#aae3451cad5c16ee6a6e124e62ed61361">More...</a><br /></td></tr>
<tr class="separator:aae3451cad5c16ee6a6e124e62ed61361"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7b339f0a957dfad045f3f28083a015e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#ae7b339f0a957dfad045f3f28083a015e">setLoopPoints</a> (<a class="el" href="structsf_1_1Music_1_1Span.html">TimeSpan</a> timePoints)</td></tr>
<tr class="memdesc:ae7b339f0a957dfad045f3f28083a015e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the beginning and end of the sound's looping sequence using <a class="el" href="classsf_1_1Time.html" title="Represents a time value. ">sf::Time</a>. <a href="#ae7b339f0a957dfad045f3f28083a015e">More...</a><br /></td></tr>
<tr class="separator:ae7b339f0a957dfad045f3f28083a015e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afdc08b69cab5f243d9324940a85a1144"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144">play</a> ()</td></tr>
<tr class="memdesc:afdc08b69cab5f243d9324940a85a1144"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start or resume playing the audio stream. <a href="#afdc08b69cab5f243d9324940a85a1144">More...</a><br /></td></tr>
<tr class="separator:afdc08b69cab5f243d9324940a85a1144"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a932ff181e661503cad288b4bb6fe45ca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#a932ff181e661503cad288b4bb6fe45ca">pause</a> ()</td></tr>
<tr class="memdesc:a932ff181e661503cad288b4bb6fe45ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pause the audio stream. <a href="#a932ff181e661503cad288b4bb6fe45ca">More...</a><br /></td></tr>
<tr class="separator:a932ff181e661503cad288b4bb6fe45ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16cc6a0404b32e42c4dce184bb94d0f4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#a16cc6a0404b32e42c4dce184bb94d0f4">stop</a> ()</td></tr>
<tr class="memdesc:a16cc6a0404b32e42c4dce184bb94d0f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop playing the audio stream. <a href="#a16cc6a0404b32e42c4dce184bb94d0f4">More...</a><br /></td></tr>
<tr class="separator:a16cc6a0404b32e42c4dce184bb94d0f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f70933912dd9498f4dc99feefed27f3"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#a1f70933912dd9498f4dc99feefed27f3">getChannelCount</a> () const</td></tr>
<tr class="memdesc:a1f70933912dd9498f4dc99feefed27f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of channels of the stream. <a href="#a1f70933912dd9498f4dc99feefed27f3">More...</a><br /></td></tr>
<tr class="separator:a1f70933912dd9498f4dc99feefed27f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7da448dc40d81a33b8dc555fbf0d3fbf"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#a7da448dc40d81a33b8dc555fbf0d3fbf">getSampleRate</a> () const</td></tr>
<tr class="memdesc:a7da448dc40d81a33b8dc555fbf0d3fbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the stream sample rate of the stream. <a href="#a7da448dc40d81a33b8dc555fbf0d3fbf">More...</a><br /></td></tr>
<tr class="separator:a7da448dc40d81a33b8dc555fbf0d3fbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64a8193ed728da37c115c65de015849f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1SoundSource.html#ac43af72c98c077500b239bc75b812f03">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#a64a8193ed728da37c115c65de015849f">getStatus</a> () const</td></tr>
<tr class="memdesc:a64a8193ed728da37c115c65de015849f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current status of the stream (stopped, paused, playing) <a href="#a64a8193ed728da37c115c65de015849f">More...</a><br /></td></tr>
<tr class="separator:a64a8193ed728da37c115c65de015849f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af416a5f84c8750d2acb9821d78bc8646"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#af416a5f84c8750d2acb9821d78bc8646">setPlayingOffset</a> (<a class="el" href="classsf_1_1Time.html">Time</a> timeOffset)</td></tr>
<tr class="memdesc:af416a5f84c8750d2acb9821d78bc8646"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the current playing position of the stream. <a href="#af416a5f84c8750d2acb9821d78bc8646">More...</a><br /></td></tr>
<tr class="separator:af416a5f84c8750d2acb9821d78bc8646"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae288f3c72edbad9cc7ee938ce5b907c1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Time.html">Time</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#ae288f3c72edbad9cc7ee938ce5b907c1">getPlayingOffset</a> () const</td></tr>
<tr class="memdesc:ae288f3c72edbad9cc7ee938ce5b907c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current playing position of the stream. <a href="#ae288f3c72edbad9cc7ee938ce5b907c1">More...</a><br /></td></tr>
<tr class="separator:ae288f3c72edbad9cc7ee938ce5b907c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a43fade018ffba7e4f847a9f00b353f3d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#a43fade018ffba7e4f847a9f00b353f3d">setLoop</a> (bool loop)</td></tr>
<tr class="memdesc:a43fade018ffba7e4f847a9f00b353f3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set whether or not the stream should loop after reaching the end. <a href="#a43fade018ffba7e4f847a9f00b353f3d">More...</a><br /></td></tr>
<tr class="separator:a43fade018ffba7e4f847a9f00b353f3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49d263f9bbaefec4b019bd05fda59b25"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#a49d263f9bbaefec4b019bd05fda59b25">getLoop</a> () const</td></tr>
<tr class="memdesc:a49d263f9bbaefec4b019bd05fda59b25"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell whether or not the stream is in loop mode. <a href="#a49d263f9bbaefec4b019bd05fda59b25">More...</a><br /></td></tr>
<tr class="separator:a49d263f9bbaefec4b019bd05fda59b25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72a13695ed48b7f7b55e7cd4431f4bb6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a72a13695ed48b7f7b55e7cd4431f4bb6">setPitch</a> (float pitch)</td></tr>
<tr class="memdesc:a72a13695ed48b7f7b55e7cd4431f4bb6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the pitch of the sound. <a href="#a72a13695ed48b7f7b55e7cd4431f4bb6">More...</a><br /></td></tr>
<tr class="separator:a72a13695ed48b7f7b55e7cd4431f4bb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f192f2b49fb8e2b82f3498d3663fcc2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a2f192f2b49fb8e2b82f3498d3663fcc2">setVolume</a> (float volume)</td></tr>
<tr class="memdesc:a2f192f2b49fb8e2b82f3498d3663fcc2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the volume of the sound. <a href="#a2f192f2b49fb8e2b82f3498d3663fcc2">More...</a><br /></td></tr>
<tr class="separator:a2f192f2b49fb8e2b82f3498d3663fcc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0480257ea25d986eba6cc3c1a6f8d7c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a0480257ea25d986eba6cc3c1a6f8d7c2">setPosition</a> (float x, float y, float z)</td></tr>
<tr class="memdesc:a0480257ea25d986eba6cc3c1a6f8d7c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the 3D position of the sound in the audio scene. <a href="#a0480257ea25d986eba6cc3c1a6f8d7c2">More...</a><br /></td></tr>
<tr class="separator:a0480257ea25d986eba6cc3c1a6f8d7c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17ba9ed01925395652181a7b2a7d3aef"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a17ba9ed01925395652181a7b2a7d3aef">setPosition</a> (const <a class="el" href="classsf_1_1Vector3.html">Vector3f</a> &amp;position)</td></tr>
<tr class="memdesc:a17ba9ed01925395652181a7b2a7d3aef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the 3D position of the sound in the audio scene. <a href="#a17ba9ed01925395652181a7b2a7d3aef">More...</a><br /></td></tr>
<tr class="separator:a17ba9ed01925395652181a7b2a7d3aef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac478a8b813faf7dd575635b102081d0d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#ac478a8b813faf7dd575635b102081d0d">setRelativeToListener</a> (bool relative)</td></tr>
<tr class="memdesc:ac478a8b813faf7dd575635b102081d0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make the sound's position relative to the listener or absolute. <a href="#ac478a8b813faf7dd575635b102081d0d">More...</a><br /></td></tr>
<tr class="separator:ac478a8b813faf7dd575635b102081d0d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75bbc2c34addc8b25a14edb908508afe"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a75bbc2c34addc8b25a14edb908508afe">setMinDistance</a> (float distance)</td></tr>
<tr class="memdesc:a75bbc2c34addc8b25a14edb908508afe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the minimum distance of the sound. <a href="#a75bbc2c34addc8b25a14edb908508afe">More...</a><br /></td></tr>
<tr class="separator:a75bbc2c34addc8b25a14edb908508afe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2adff44cd2f8b4e3c7315d7c2a45626"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#aa2adff44cd2f8b4e3c7315d7c2a45626">setAttenuation</a> (float attenuation)</td></tr>
<tr class="memdesc:aa2adff44cd2f8b4e3c7315d7c2a45626"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the attenuation factor of the sound. <a href="#aa2adff44cd2f8b4e3c7315d7c2a45626">More...</a><br /></td></tr>
<tr class="separator:aa2adff44cd2f8b4e3c7315d7c2a45626"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4736acc2c802f927544c9ce52a44a9e4"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a4736acc2c802f927544c9ce52a44a9e4">getPitch</a> () const</td></tr>
<tr class="memdesc:a4736acc2c802f927544c9ce52a44a9e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the pitch of the sound. <a href="#a4736acc2c802f927544c9ce52a44a9e4">More...</a><br /></td></tr>
<tr class="separator:a4736acc2c802f927544c9ce52a44a9e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04243fb5edf64561689b1d58953fc4ce"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a04243fb5edf64561689b1d58953fc4ce">getVolume</a> () const</td></tr>
<tr class="memdesc:a04243fb5edf64561689b1d58953fc4ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the volume of the sound. <a href="#a04243fb5edf64561689b1d58953fc4ce">More...</a><br /></td></tr>
<tr class="separator:a04243fb5edf64561689b1d58953fc4ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d199521f55550c7a3b2b0f6950dffa1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Vector3.html">Vector3f</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a8d199521f55550c7a3b2b0f6950dffa1">getPosition</a> () const</td></tr>
<tr class="memdesc:a8d199521f55550c7a3b2b0f6950dffa1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the 3D position of the sound in the audio scene. <a href="#a8d199521f55550c7a3b2b0f6950dffa1">More...</a><br /></td></tr>
<tr class="separator:a8d199521f55550c7a3b2b0f6950dffa1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adcdb4ef32c2f4481d34aff0b5c31534b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#adcdb4ef32c2f4481d34aff0b5c31534b">isRelativeToListener</a> () const</td></tr>
<tr class="memdesc:adcdb4ef32c2f4481d34aff0b5c31534b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell whether the sound's position is relative to the listener or is absolute. <a href="#adcdb4ef32c2f4481d34aff0b5c31534b">More...</a><br /></td></tr>
<tr class="separator:adcdb4ef32c2f4481d34aff0b5c31534b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a605ca7f359ec1c36fcccdcd4696562ac"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a605ca7f359ec1c36fcccdcd4696562ac">getMinDistance</a> () const</td></tr>
<tr class="memdesc:a605ca7f359ec1c36fcccdcd4696562ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the minimum distance of the sound. <a href="#a605ca7f359ec1c36fcccdcd4696562ac">More...</a><br /></td></tr>
<tr class="separator:a605ca7f359ec1c36fcccdcd4696562ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ad7dafb4f1b4afbc638cebe24f48cc9"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a8ad7dafb4f1b4afbc638cebe24f48cc9">getAttenuation</a> () const</td></tr>
<tr class="memdesc:a8ad7dafb4f1b4afbc638cebe24f48cc9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the attenuation factor of the sound. <a href="#a8ad7dafb4f1b4afbc638cebe24f48cc9">More...</a><br /></td></tr>
<tr class="separator:a8ad7dafb4f1b4afbc638cebe24f48cc9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr class="memitem:a7707214e7cd4ffcf1c123e7bcab4092a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="classsf_1_1SoundStream.html#a7707214e7cd4ffcf1c123e7bcab4092aa2f2c638731fdff0d6fe4e3e82b6f6146">NoLoop</a> = -1
}</td></tr>
<tr class="separator:a7707214e7cd4ffcf1c123e7bcab4092a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aca1bcb4e5d56a854133e74bd86374463"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#aca1bcb4e5d56a854133e74bd86374463">onGetData</a> (<a class="el" href="structsf_1_1SoundStream_1_1Chunk.html">Chunk</a> &amp;data)</td></tr>
<tr class="memdesc:aca1bcb4e5d56a854133e74bd86374463"><td class="mdescLeft">&#160;</td><td class="mdescRight">Request a new chunk of audio samples from the stream source. <a href="#aca1bcb4e5d56a854133e74bd86374463">More...</a><br /></td></tr>
<tr class="separator:aca1bcb4e5d56a854133e74bd86374463"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15119cc0419c16bb334fa0698699c02e"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#a15119cc0419c16bb334fa0698699c02e">onSeek</a> (<a class="el" href="classsf_1_1Time.html">Time</a> timeOffset)</td></tr>
<tr class="memdesc:a15119cc0419c16bb334fa0698699c02e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the current playing position in the stream source. <a href="#a15119cc0419c16bb334fa0698699c02e">More...</a><br /></td></tr>
<tr class="separator:a15119cc0419c16bb334fa0698699c02e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa68a64bdaf5d16e9ed64f202f5c45e03"><td class="memItemLeft" align="right" valign="top">virtual Int64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Music.html#aa68a64bdaf5d16e9ed64f202f5c45e03">onLoop</a> ()</td></tr>
<tr class="memdesc:aa68a64bdaf5d16e9ed64f202f5c45e03"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the current playing position in the stream source to the loop offset. <a href="#aa68a64bdaf5d16e9ed64f202f5c45e03">More...</a><br /></td></tr>
<tr class="separator:aa68a64bdaf5d16e9ed64f202f5c45e03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c351711198ee1aa77c2fefd3ced4d2c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.html#a9c351711198ee1aa77c2fefd3ced4d2c">initialize</a> (unsigned int channelCount, unsigned int sampleRate)</td></tr>
<tr class="memdesc:a9c351711198ee1aa77c2fefd3ced4d2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define the audio stream parameters. <a href="#a9c351711198ee1aa77c2fefd3ced4d2c">More...</a><br /></td></tr>
<tr class="separator:a9c351711198ee1aa77c2fefd3ced4d2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a0223cef4b1c587e6e1e17b4c92c4479c"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundSource.html#a0223cef4b1c587e6e1e17b4c92c4479c">m_source</a></td></tr>
<tr class="memdesc:a0223cef4b1c587e6e1e17b4c92c4479c"><td class="mdescLeft">&#160;</td><td class="mdescRight">OpenAL source identifier. <a href="#a0223cef4b1c587e6e1e17b4c92c4479c">More...</a><br /></td></tr>
<tr class="separator:a0223cef4b1c587e6e1e17b4c92c4479c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Streamed music played from an audio file. </p>
<p>Musics are sounds that are streamed rather than completely loaded in memory.</p>
<p>This is especially useful for compressed musics that usually take hundreds of MB when they are uncompressed: by streaming it instead of loading it entirely, you avoid saturating the memory and have almost no loading delay. This implies that the underlying resource (file, stream or memory buffer) must remain valid for the lifetime of the <a class="el" href="classsf_1_1Music.html" title="Streamed music played from an audio file. ">sf::Music</a> object.</p>
<p>Apart from that, a <a class="el" href="classsf_1_1Music.html" title="Streamed music played from an audio file. ">sf::Music</a> has almost the same features as the <a class="el" href="classsf_1_1SoundBuffer.html" title="Storage for audio samples defining a sound. ">sf::SoundBuffer</a> / <a class="el" href="classsf_1_1Sound.html" title="Regular sound that can be played in the audio environment. ">sf::Sound</a> pair: you can play/pause/stop it, request its parameters (channels, sample rate), change the way it is played (pitch, volume, 3D position, ...), etc.</p>
<p>As a sound stream, a music is played in its own thread in order not to block the rest of the program. This means that you can leave the music alone after calling <a class="el" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144" title="Start or resume playing the audio stream. ">play()</a>, it will manage itself very well.</p>
<p>Usage example: </p><div class="fragment"><div class="line"><span class="comment">// Declare a new music</span></div><div class="line"><a class="code" href="classsf_1_1Music.html">sf::Music</a> music;</div><div class="line"></div><div class="line"><span class="comment">// Open it from an audio file</span></div><div class="line"><span class="keywordflow">if</span> (!music.<a class="code" href="classsf_1_1Music.html#a3edc66e5f5b3f11e84b90eaec9c7d7c0">openFromFile</a>(<span class="stringliteral">&quot;music.ogg&quot;</span>))</div><div class="line">{</div><div class="line"> <span class="comment">// error...</span></div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">// Change some parameters</span></div><div class="line">music.<a class="code" href="classsf_1_1SoundSource.html#a0480257ea25d986eba6cc3c1a6f8d7c2">setPosition</a>(0, 1, 10); <span class="comment">// change its 3D position</span></div><div class="line">music.<a class="code" href="classsf_1_1SoundSource.html#a72a13695ed48b7f7b55e7cd4431f4bb6">setPitch</a>(2); <span class="comment">// increase the pitch</span></div><div class="line">music.<a class="code" href="classsf_1_1SoundSource.html#a2f192f2b49fb8e2b82f3498d3663fcc2">setVolume</a>(50); <span class="comment">// reduce the volume</span></div><div class="line">music.<a class="code" href="classsf_1_1SoundStream.html#a43fade018ffba7e4f847a9f00b353f3d">setLoop</a>(<span class="keyword">true</span>); <span class="comment">// make it loop</span></div><div class="line"></div><div class="line"><span class="comment">// Play it</span></div><div class="line">music.<a class="code" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144">play</a>();</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Sound.html" title="Regular sound that can be played in the audio environment. ">sf::Sound</a>, <a class="el" href="classsf_1_1SoundStream.html" title="Abstract base class for streamed audio sources. ">sf::SoundStream</a> </dd></dl>
<p class="definition">Definition at line <a class="el" href="Music_8hpp_source.html#l00048">48</a> of file <a class="el" href="Music_8hpp_source.html">Music.hpp</a>.</p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a7707214e7cd4ffcf1c123e7bcab4092a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7707214e7cd4ffcf1c123e7bcab4092a">&#9670;&nbsp;</a></span>anonymous enum</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">anonymous enum</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a7707214e7cd4ffcf1c123e7bcab4092aa2f2c638731fdff0d6fe4e3e82b6f6146"></a>NoLoop&#160;</td><td class="fielddoc"><p>"Invalid" endSeeks value, telling us to continue uninterrupted </p>
</td></tr>
</table>
<p class="definition">Definition at line <a class="el" href="SoundStream_8hpp_source.html#l00183">183</a> of file <a class="el" href="SoundStream_8hpp_source.html">SoundStream.hpp</a>.</p>
</div>
</div>
<a id="ac43af72c98c077500b239bc75b812f03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac43af72c98c077500b239bc75b812f03">&#9670;&nbsp;</a></span>Status</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classsf_1_1SoundSource.html#ac43af72c98c077500b239bc75b812f03">sf::SoundSource::Status</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Enumeration of the sound source states. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ac43af72c98c077500b239bc75b812f03adabb01e8aa85b2f54b344890addf764a"></a>Stopped&#160;</td><td class="fielddoc"><p><a class="el" href="classsf_1_1Sound.html" title="Regular sound that can be played in the audio environment. ">Sound</a> is not playing. </p>
</td></tr>
<tr><td class="fieldname"><a id="ac43af72c98c077500b239bc75b812f03ac3ca1fcc0394267c9bdbe3dc0a8a7e41"></a>Paused&#160;</td><td class="fielddoc"><p><a class="el" href="classsf_1_1Sound.html" title="Regular sound that can be played in the audio environment. ">Sound</a> is paused. </p>
</td></tr>
<tr><td class="fieldname"><a id="ac43af72c98c077500b239bc75b812f03af07bdea9f70ef7606dfc9f955beeee18"></a>Playing&#160;</td><td class="fielddoc"><p><a class="el" href="classsf_1_1Sound.html" title="Regular sound that can be played in the audio environment. ">Sound</a> is playing. </p>
</td></tr>
</table>
<p class="definition">Definition at line <a class="el" href="SoundSource_8hpp_source.html#l00050">50</a> of file <a class="el" href="SoundSource_8hpp_source.html">SoundSource.hpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a0bc787d8e022b3a9b89cf2c28befd42e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0bc787d8e022b3a9b89cf2c28befd42e">&#9670;&nbsp;</a></span>Music()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::Music::Music </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
</div>
</div>
<a id="a4c65860fed2f01d0eaa6c4199870414b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c65860fed2f01d0eaa6c4199870414b">&#9670;&nbsp;</a></span>~Music()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::Music::~Music </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a8ad7dafb4f1b4afbc638cebe24f48cc9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ad7dafb4f1b4afbc638cebe24f48cc9">&#9670;&nbsp;</a></span>getAttenuation()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">float sf::SoundSource::getAttenuation </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the attenuation factor of the sound. </p>
<dl class="section return"><dt>Returns</dt><dd>Attenuation factor of the sound</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#aa2adff44cd2f8b4e3c7315d7c2a45626" title="Set the attenuation factor of the sound. ">setAttenuation</a>, <a class="el" href="classsf_1_1SoundSource.html#a605ca7f359ec1c36fcccdcd4696562ac" title="Get the minimum distance of the sound. ">getMinDistance</a> </dd></dl>
</div>
</div>
<a id="a1f70933912dd9498f4dc99feefed27f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f70933912dd9498f4dc99feefed27f3">&#9670;&nbsp;</a></span>getChannelCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">unsigned int sf::SoundStream::getChannelCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the number of channels of the stream. </p>
<p>1 channel means a mono sound, 2 means stereo, etc.</p>
<dl class="section return"><dt>Returns</dt><dd>Number of channels </dd></dl>
</div>
</div>
<a id="a288ef6f552a136b0e56952dcada3d672"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a288ef6f552a136b0e56952dcada3d672">&#9670;&nbsp;</a></span>getDuration()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Time.html">Time</a> sf::Music::getDuration </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the total duration of the music. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classsf_1_1Music.html" title="Streamed music played from an audio file. ">Music</a> duration </dd></dl>
</div>
</div>
<a id="a49d263f9bbaefec4b019bd05fda59b25"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a49d263f9bbaefec4b019bd05fda59b25">&#9670;&nbsp;</a></span>getLoop()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool sf::SoundStream::getLoop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Tell whether or not the stream is in loop mode. </p>
<dl class="section return"><dt>Returns</dt><dd>True if the stream is looping, false otherwise</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundStream.html#a43fade018ffba7e4f847a9f00b353f3d" title="Set whether or not the stream should loop after reaching the end. ">setLoop</a> </dd></dl>
</div>
</div>
<a id="aae3451cad5c16ee6a6e124e62ed61361"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae3451cad5c16ee6a6e124e62ed61361">&#9670;&nbsp;</a></span>getLoopPoints()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structsf_1_1Music_1_1Span.html">TimeSpan</a> sf::Music::getLoopPoints </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the positions of the of the sound's looping sequence. </p>
<dl class="section return"><dt>Returns</dt><dd>Loop <a class="el" href="classsf_1_1Time.html" title="Represents a time value. ">Time</a> position class.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>Since <a class="el" href="classsf_1_1Music.html#ae7b339f0a957dfad045f3f28083a015e" title="Sets the beginning and end of the sound&#39;s looping sequence using sf::Time. ">setLoopPoints()</a> performs some adjustments on the provided values and rounds them to internal samples, a call to <a class="el" href="classsf_1_1Music.html#aae3451cad5c16ee6a6e124e62ed61361" title="Get the positions of the of the sound&#39;s looping sequence. ">getLoopPoints()</a> is not guaranteed to return the same times passed into a previous call to <a class="el" href="classsf_1_1Music.html#ae7b339f0a957dfad045f3f28083a015e" title="Sets the beginning and end of the sound&#39;s looping sequence using sf::Time. ">setLoopPoints()</a>. However, it is guaranteed to return times that will map to the valid internal samples of this <a class="el" href="classsf_1_1Music.html" title="Streamed music played from an audio file. ">Music</a> if they are later passed to <a class="el" href="classsf_1_1Music.html#ae7b339f0a957dfad045f3f28083a015e" title="Sets the beginning and end of the sound&#39;s looping sequence using sf::Time. ">setLoopPoints()</a>.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Music.html#ae7b339f0a957dfad045f3f28083a015e" title="Sets the beginning and end of the sound&#39;s looping sequence using sf::Time. ">setLoopPoints</a> </dd></dl>
</div>
</div>
<a id="a605ca7f359ec1c36fcccdcd4696562ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a605ca7f359ec1c36fcccdcd4696562ac">&#9670;&nbsp;</a></span>getMinDistance()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">float sf::SoundSource::getMinDistance </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the minimum distance of the sound. </p>
<dl class="section return"><dt>Returns</dt><dd>Minimum distance of the sound</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a75bbc2c34addc8b25a14edb908508afe" title="Set the minimum distance of the sound. ">setMinDistance</a>, <a class="el" href="classsf_1_1SoundSource.html#a8ad7dafb4f1b4afbc638cebe24f48cc9" title="Get the attenuation factor of the sound. ">getAttenuation</a> </dd></dl>
</div>
</div>
<a id="a4736acc2c802f927544c9ce52a44a9e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4736acc2c802f927544c9ce52a44a9e4">&#9670;&nbsp;</a></span>getPitch()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">float sf::SoundSource::getPitch </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the pitch of the sound. </p>
<dl class="section return"><dt>Returns</dt><dd>Pitch of the sound</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a72a13695ed48b7f7b55e7cd4431f4bb6" title="Set the pitch of the sound. ">setPitch</a> </dd></dl>
</div>
</div>
<a id="ae288f3c72edbad9cc7ee938ce5b907c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae288f3c72edbad9cc7ee938ce5b907c1">&#9670;&nbsp;</a></span>getPlayingOffset()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Time.html">Time</a> sf::SoundStream::getPlayingOffset </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the current playing position of the stream. </p>
<dl class="section return"><dt>Returns</dt><dd>Current playing position, from the beginning of the stream</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundStream.html#af416a5f84c8750d2acb9821d78bc8646" title="Change the current playing position of the stream. ">setPlayingOffset</a> </dd></dl>
</div>
</div>
<a id="a8d199521f55550c7a3b2b0f6950dffa1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d199521f55550c7a3b2b0f6950dffa1">&#9670;&nbsp;</a></span>getPosition()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Vector3.html">Vector3f</a> sf::SoundSource::getPosition </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the 3D position of the sound in the audio scene. </p>
<dl class="section return"><dt>Returns</dt><dd>Position of the sound</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a0480257ea25d986eba6cc3c1a6f8d7c2" title="Set the 3D position of the sound in the audio scene. ">setPosition</a> </dd></dl>
</div>
</div>
<a id="a7da448dc40d81a33b8dc555fbf0d3fbf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7da448dc40d81a33b8dc555fbf0d3fbf">&#9670;&nbsp;</a></span>getSampleRate()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">unsigned int sf::SoundStream::getSampleRate </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the stream sample rate of the stream. </p>
<p>The sample rate is the number of audio samples played per second. The higher, the better the quality.</p>
<dl class="section return"><dt>Returns</dt><dd>Sample rate, in number of samples per second </dd></dl>
</div>
</div>
<a id="a64a8193ed728da37c115c65de015849f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a64a8193ed728da37c115c65de015849f">&#9670;&nbsp;</a></span>getStatus()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1SoundSource.html#ac43af72c98c077500b239bc75b812f03">Status</a> sf::SoundStream::getStatus </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the current status of the stream (stopped, paused, playing) </p>
<dl class="section return"><dt>Returns</dt><dd>Current status </dd></dl>
<p>Reimplemented from <a class="el" href="classsf_1_1SoundSource.html#aa8d313c31b968159582a999aa66e5ed7">sf::SoundSource</a>.</p>
</div>
</div>
<a id="a04243fb5edf64561689b1d58953fc4ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04243fb5edf64561689b1d58953fc4ce">&#9670;&nbsp;</a></span>getVolume()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">float sf::SoundSource::getVolume </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the volume of the sound. </p>
<dl class="section return"><dt>Returns</dt><dd>Volume of the sound, in the range [0, 100]</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a2f192f2b49fb8e2b82f3498d3663fcc2" title="Set the volume of the sound. ">setVolume</a> </dd></dl>
</div>
</div>
<a id="a9c351711198ee1aa77c2fefd3ced4d2c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c351711198ee1aa77c2fefd3ced4d2c">&#9670;&nbsp;</a></span>initialize()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundStream::initialize </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>channelCount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>sampleRate</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Define the audio stream parameters. </p>
<p>This function must be called by derived classes as soon as they know the audio settings of the stream to play. Any attempt to manipulate the stream (<a class="el" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144" title="Start or resume playing the audio stream. ">play()</a>, ...) before calling this function will fail. It can be called multiple times if the settings of the audio stream change, but only when the stream is stopped.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">channelCount</td><td>Number of channels of the stream </td></tr>
<tr><td class="paramname">sampleRate</td><td>Sample rate, in samples per second </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="adcdb4ef32c2f4481d34aff0b5c31534b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adcdb4ef32c2f4481d34aff0b5c31534b">&#9670;&nbsp;</a></span>isRelativeToListener()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool sf::SoundSource::isRelativeToListener </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Tell whether the sound's position is relative to the listener or is absolute. </p>
<dl class="section return"><dt>Returns</dt><dd>True if the position is relative, false if it's absolute</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#ac478a8b813faf7dd575635b102081d0d" title="Make the sound&#39;s position relative to the listener or absolute. ">setRelativeToListener</a> </dd></dl>
</div>
</div>
<a id="aca1bcb4e5d56a854133e74bd86374463"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aca1bcb4e5d56a854133e74bd86374463">&#9670;&nbsp;</a></span>onGetData()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bool sf::Music::onGetData </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structsf_1_1SoundStream_1_1Chunk.html">Chunk</a> &amp;&#160;</td>
<td class="paramname"><em>data</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Request a new chunk of audio samples from the stream source. </p>
<p>This function fills the chunk from the next samples to read from the audio file.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Chunk of data to fill</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True to continue playback, false to stop </dd></dl>
<p>Implements <a class="el" href="classsf_1_1SoundStream.html#a968ec024a6e45490962c8a1121cb7c5f">sf::SoundStream</a>.</p>
</div>
</div>
<a id="aa68a64bdaf5d16e9ed64f202f5c45e03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa68a64bdaf5d16e9ed64f202f5c45e03">&#9670;&nbsp;</a></span>onLoop()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual Int64 sf::Music::onLoop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Change the current playing position in the stream source to the loop offset. </p>
<p>This is called by the underlying <a class="el" href="classsf_1_1SoundStream.html" title="Abstract base class for streamed audio sources. ">SoundStream</a> whenever it needs us to reset the seek position for a loop. We then determine whether we are looping on a loop point or the end-of-file, perform the seek, and return the new position.</p>
<dl class="section return"><dt>Returns</dt><dd>The seek position after looping (or -1 if there's no loop) </dd></dl>
<p>Reimplemented from <a class="el" href="classsf_1_1SoundStream.html#a3f717d18846f261fc375d71d6c7e41da">sf::SoundStream</a>.</p>
</div>
</div>
<a id="a15119cc0419c16bb334fa0698699c02e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a15119cc0419c16bb334fa0698699c02e">&#9670;&nbsp;</a></span>onSeek()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void sf::Music::onSeek </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classsf_1_1Time.html">Time</a>&#160;</td>
<td class="paramname"><em>timeOffset</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Change the current playing position in the stream source. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">timeOffset</td><td>New playing position, from the beginning of the music </td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="classsf_1_1SoundStream.html#a907036dd2ca7d3af5ead316e54b75997">sf::SoundStream</a>.</p>
</div>
</div>
<a id="a3edc66e5f5b3f11e84b90eaec9c7d7c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3edc66e5f5b3f11e84b90eaec9c7d7c0">&#9670;&nbsp;</a></span>openFromFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool sf::Music::openFromFile </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>filename</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Open a music from an audio file. </p>
<p>This function doesn't start playing the music (call <a class="el" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144" title="Start or resume playing the audio stream. ">play()</a> to do so). See the documentation of <a class="el" href="classsf_1_1InputSoundFile.html" title="Provide read access to sound files. ">sf::InputSoundFile</a> for the list of supported formats.</p>
<dl class="section warning"><dt>Warning</dt><dd>Since the music is not loaded at once but rather streamed continuously, the file must remain accessible until the <a class="el" href="classsf_1_1Music.html" title="Streamed music played from an audio file. ">sf::Music</a> object loads a new music or is destroyed.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>Path of the music file to open</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if loading succeeded, false if it failed</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Music.html#ae93b21bcf28ff0b5fec458039111386e" title="Open a music from an audio file in memory. ">openFromMemory</a>, <a class="el" href="classsf_1_1Music.html#a4e55d1910a26858b44778c26b237d673" title="Open a music from an audio file in a custom stream. ">openFromStream</a> </dd></dl>
</div>
</div>
<a id="ae93b21bcf28ff0b5fec458039111386e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae93b21bcf28ff0b5fec458039111386e">&#9670;&nbsp;</a></span>openFromMemory()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool sf::Music::openFromMemory </td>
<td>(</td>
<td class="paramtype">const void *&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>sizeInBytes</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Open a music from an audio file in memory. </p>
<p>This function doesn't start playing the music (call <a class="el" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144" title="Start or resume playing the audio stream. ">play()</a> to do so). See the documentation of <a class="el" href="classsf_1_1InputSoundFile.html" title="Provide read access to sound files. ">sf::InputSoundFile</a> for the list of supported formats.</p>
<dl class="section warning"><dt>Warning</dt><dd>Since the music is not loaded at once but rather streamed continuously, the <em>data</em> buffer must remain accessible until the <a class="el" href="classsf_1_1Music.html" title="Streamed music played from an audio file. ">sf::Music</a> object loads a new music or is destroyed. That is, you can't deallocate the buffer right after calling this function.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Pointer to the file data in memory </td></tr>
<tr><td class="paramname">sizeInBytes</td><td>Size of the data to load, in bytes</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if loading succeeded, false if it failed</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Music.html#a3edc66e5f5b3f11e84b90eaec9c7d7c0" title="Open a music from an audio file. ">openFromFile</a>, <a class="el" href="classsf_1_1Music.html#a4e55d1910a26858b44778c26b237d673" title="Open a music from an audio file in a custom stream. ">openFromStream</a> </dd></dl>
</div>
</div>
<a id="a4e55d1910a26858b44778c26b237d673"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e55d1910a26858b44778c26b237d673">&#9670;&nbsp;</a></span>openFromStream()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool sf::Music::openFromStream </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classsf_1_1InputStream.html">InputStream</a> &amp;&#160;</td>
<td class="paramname"><em>stream</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Open a music from an audio file in a custom stream. </p>
<p>This function doesn't start playing the music (call <a class="el" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144" title="Start or resume playing the audio stream. ">play()</a> to do so). See the documentation of <a class="el" href="classsf_1_1InputSoundFile.html" title="Provide read access to sound files. ">sf::InputSoundFile</a> for the list of supported formats.</p>
<dl class="section warning"><dt>Warning</dt><dd>Since the music is not loaded at once but rather streamed continuously, the <em>stream</em> must remain accessible until the <a class="el" href="classsf_1_1Music.html" title="Streamed music played from an audio file. ">sf::Music</a> object loads a new music or is destroyed.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">stream</td><td>Source stream to read from</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if loading succeeded, false if it failed</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Music.html#a3edc66e5f5b3f11e84b90eaec9c7d7c0" title="Open a music from an audio file. ">openFromFile</a>, <a class="el" href="classsf_1_1Music.html#ae93b21bcf28ff0b5fec458039111386e" title="Open a music from an audio file in memory. ">openFromMemory</a> </dd></dl>
</div>
</div>
<a id="a932ff181e661503cad288b4bb6fe45ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a932ff181e661503cad288b4bb6fe45ca">&#9670;&nbsp;</a></span>pause()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundStream::pause </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Pause the audio stream. </p>
<p>This function pauses the stream if it was playing, otherwise (stream already paused or stopped) it has no effect.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144" title="Start or resume playing the audio stream. ">play</a>, <a class="el" href="classsf_1_1SoundStream.html#a16cc6a0404b32e42c4dce184bb94d0f4" title="Stop playing the audio stream. ">stop</a> </dd></dl>
<p>Implements <a class="el" href="classsf_1_1SoundSource.html#a21553d4e8fcf136231dd8c7ad4630aba">sf::SoundSource</a>.</p>
</div>
</div>
<a id="afdc08b69cab5f243d9324940a85a1144"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afdc08b69cab5f243d9324940a85a1144">&#9670;&nbsp;</a></span>play()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundStream::play </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Start or resume playing the audio stream. </p>
<p>This function starts the stream if it was stopped, resumes it if it was paused, and restarts it from the beginning if it was already playing. This function uses its own thread so that it doesn't block the rest of the program while the stream is played.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundStream.html#a932ff181e661503cad288b4bb6fe45ca" title="Pause the audio stream. ">pause</a>, <a class="el" href="classsf_1_1SoundStream.html#a16cc6a0404b32e42c4dce184bb94d0f4" title="Stop playing the audio stream. ">stop</a> </dd></dl>
<p>Implements <a class="el" href="classsf_1_1SoundSource.html#a6e1bbb1f247ed8743faf3b1ed6f2bc21">sf::SoundSource</a>.</p>
</div>
</div>
<a id="aa2adff44cd2f8b4e3c7315d7c2a45626"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2adff44cd2f8b4e3c7315d7c2a45626">&#9670;&nbsp;</a></span>setAttenuation()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundSource::setAttenuation </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>attenuation</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the attenuation factor of the sound. </p>
<p>The attenuation is a multiplicative factor which makes the sound more or less loud according to its distance from the listener. An attenuation of 0 will produce a non-attenuated sound, i.e. its volume will always be the same whether it is heard from near or from far. On the other hand, an attenuation value such as 100 will make the sound fade out very quickly as it gets further from the listener. The default value of the attenuation is 1.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">attenuation</td><td>New attenuation factor of the sound</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a8ad7dafb4f1b4afbc638cebe24f48cc9" title="Get the attenuation factor of the sound. ">getAttenuation</a>, <a class="el" href="classsf_1_1SoundSource.html#a75bbc2c34addc8b25a14edb908508afe" title="Set the minimum distance of the sound. ">setMinDistance</a> </dd></dl>
</div>
</div>
<a id="a43fade018ffba7e4f847a9f00b353f3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a43fade018ffba7e4f847a9f00b353f3d">&#9670;&nbsp;</a></span>setLoop()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundStream::setLoop </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>loop</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set whether or not the stream should loop after reaching the end. </p>
<p>If set, the stream will restart from beginning after reaching the end and so on, until it is stopped or setLoop(false) is called. The default looping state for streams is false.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">loop</td><td>True to play in loop, false to play once</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundStream.html#a49d263f9bbaefec4b019bd05fda59b25" title="Tell whether or not the stream is in loop mode. ">getLoop</a> </dd></dl>
</div>
</div>
<a id="ae7b339f0a957dfad045f3f28083a015e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7b339f0a957dfad045f3f28083a015e">&#9670;&nbsp;</a></span>setLoopPoints()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::Music::setLoopPoints </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structsf_1_1Music_1_1Span.html">TimeSpan</a>&#160;</td>
<td class="paramname"><em>timePoints</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the beginning and end of the sound's looping sequence using <a class="el" href="classsf_1_1Time.html" title="Represents a time value. ">sf::Time</a>. </p>
<p>Loop points allow one to specify a pair of positions such that, when the music is enabled for looping, it will seamlessly seek to the beginning whenever it encounters the end. Valid ranges for timePoints.offset and timePoints.length are [0, Dur) and (0, Dur-offset] respectively, where Dur is the value returned by <a class="el" href="classsf_1_1Music.html#a288ef6f552a136b0e56952dcada3d672" title="Get the total duration of the music. ">getDuration()</a>. Note that the EOF "loop point" from the end to the beginning of the stream is still honored, in case the caller seeks to a point after the end of the loop range. This function can be safely called at any point after a stream is opened, and will be applied to a playing sound without affecting the current playing offset.</p>
<dl class="section warning"><dt>Warning</dt><dd>Setting the loop points while the stream's status is Paused will set its status to Stopped. The playing offset will be unaffected.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">timePoints</td><td>The definition of the loop. Can be any time points within the sound's length</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Music.html#aae3451cad5c16ee6a6e124e62ed61361" title="Get the positions of the of the sound&#39;s looping sequence. ">getLoopPoints</a> </dd></dl>
</div>
</div>
<a id="a75bbc2c34addc8b25a14edb908508afe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a75bbc2c34addc8b25a14edb908508afe">&#9670;&nbsp;</a></span>setMinDistance()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundSource::setMinDistance </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>distance</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the minimum distance of the sound. </p>
<p>The "minimum distance" of a sound is the maximum distance at which it is heard at its maximum volume. Further than the minimum distance, it will start to fade out according to its attenuation factor. A value of 0 ("inside the head
of the listener") is an invalid value and is forbidden. The default value of the minimum distance is 1.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">distance</td><td>New minimum distance of the sound</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a605ca7f359ec1c36fcccdcd4696562ac" title="Get the minimum distance of the sound. ">getMinDistance</a>, <a class="el" href="classsf_1_1SoundSource.html#aa2adff44cd2f8b4e3c7315d7c2a45626" title="Set the attenuation factor of the sound. ">setAttenuation</a> </dd></dl>
</div>
</div>
<a id="a72a13695ed48b7f7b55e7cd4431f4bb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a72a13695ed48b7f7b55e7cd4431f4bb6">&#9670;&nbsp;</a></span>setPitch()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundSource::setPitch </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>pitch</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the pitch of the sound. </p>
<p>The pitch represents the perceived fundamental frequency of a sound; thus you can make a sound more acute or grave by changing its pitch. A side effect of changing the pitch is to modify the playing speed of the sound as well. The default value for the pitch is 1.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pitch</td><td>New pitch to apply to the sound</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a4736acc2c802f927544c9ce52a44a9e4" title="Get the pitch of the sound. ">getPitch</a> </dd></dl>
</div>
</div>
<a id="af416a5f84c8750d2acb9821d78bc8646"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af416a5f84c8750d2acb9821d78bc8646">&#9670;&nbsp;</a></span>setPlayingOffset()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundStream::setPlayingOffset </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classsf_1_1Time.html">Time</a>&#160;</td>
<td class="paramname"><em>timeOffset</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Change the current playing position of the stream. </p>
<p>The playing position can be changed when the stream is either paused or playing. Changing the playing position when the stream is stopped has no effect, since playing the stream would reset its position.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">timeOffset</td><td>New playing position, from the beginning of the stream</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundStream.html#ae288f3c72edbad9cc7ee938ce5b907c1" title="Get the current playing position of the stream. ">getPlayingOffset</a> </dd></dl>
</div>
</div>
<a id="a0480257ea25d986eba6cc3c1a6f8d7c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0480257ea25d986eba6cc3c1a6f8d7c2">&#9670;&nbsp;</a></span>setPosition() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundSource::setPosition </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>z</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the 3D position of the sound in the audio scene. </p>
<p>Only sounds with one channel (mono sounds) can be spatialized. The default position of a sound is (0, 0, 0).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x</td><td>X coordinate of the position of the sound in the scene </td></tr>
<tr><td class="paramname">y</td><td>Y coordinate of the position of the sound in the scene </td></tr>
<tr><td class="paramname">z</td><td>Z coordinate of the position of the sound in the scene</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a8d199521f55550c7a3b2b0f6950dffa1" title="Get the 3D position of the sound in the audio scene. ">getPosition</a> </dd></dl>
</div>
</div>
<a id="a17ba9ed01925395652181a7b2a7d3aef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17ba9ed01925395652181a7b2a7d3aef">&#9670;&nbsp;</a></span>setPosition() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundSource::setPosition </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector3.html">Vector3f</a> &amp;&#160;</td>
<td class="paramname"><em>position</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the 3D position of the sound in the audio scene. </p>
<p>Only sounds with one channel (mono sounds) can be spatialized. The default position of a sound is (0, 0, 0).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">position</td><td>Position of the sound in the scene</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a8d199521f55550c7a3b2b0f6950dffa1" title="Get the 3D position of the sound in the audio scene. ">getPosition</a> </dd></dl>
</div>
</div>
<a id="ac478a8b813faf7dd575635b102081d0d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac478a8b813faf7dd575635b102081d0d">&#9670;&nbsp;</a></span>setRelativeToListener()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundSource::setRelativeToListener </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>relative</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Make the sound's position relative to the listener or absolute. </p>
<p>Making a sound relative to the listener will ensure that it will always be played the same way regardless of the position of the listener. This can be useful for non-spatialized sounds, sounds that are produced by the listener, or sounds attached to it. The default value is false (position is absolute).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">relative</td><td>True to set the position relative, false to set it absolute</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#adcdb4ef32c2f4481d34aff0b5c31534b" title="Tell whether the sound&#39;s position is relative to the listener or is absolute. ">isRelativeToListener</a> </dd></dl>
</div>
</div>
<a id="a2f192f2b49fb8e2b82f3498d3663fcc2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f192f2b49fb8e2b82f3498d3663fcc2">&#9670;&nbsp;</a></span>setVolume()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundSource::setVolume </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>volume</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the volume of the sound. </p>
<p>The volume is a value between 0 (mute) and 100 (full volume). The default value for the volume is 100.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">volume</td><td>Volume of the sound</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundSource.html#a04243fb5edf64561689b1d58953fc4ce" title="Get the volume of the sound. ">getVolume</a> </dd></dl>
</div>
</div>
<a id="a16cc6a0404b32e42c4dce184bb94d0f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16cc6a0404b32e42c4dce184bb94d0f4">&#9670;&nbsp;</a></span>stop()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::SoundStream::stop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Stop playing the audio stream. </p>
<p>This function stops the stream if it was playing or paused, and does nothing if it was already stopped. It also resets the playing position (unlike <a class="el" href="classsf_1_1SoundStream.html#a932ff181e661503cad288b4bb6fe45ca" title="Pause the audio stream. ">pause()</a>).</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1SoundStream.html#afdc08b69cab5f243d9324940a85a1144" title="Start or resume playing the audio stream. ">play</a>, <a class="el" href="classsf_1_1SoundStream.html#a932ff181e661503cad288b4bb6fe45ca" title="Pause the audio stream. ">pause</a> </dd></dl>
<p>Implements <a class="el" href="classsf_1_1SoundSource.html#a06501a25b12376befcc7ee1ed4865fda">sf::SoundSource</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a0223cef4b1c587e6e1e17b4c92c4479c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0223cef4b1c587e6e1e17b4c92c4479c">&#9670;&nbsp;</a></span>m_source</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">unsigned int sf::SoundSource::m_source</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>OpenAL source identifier. </p>
<p class="definition">Definition at line <a class="el" href="SoundSource_8hpp_source.html#l00309">309</a> of file <a class="el" href="SoundSource_8hpp_source.html">SoundSource.hpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Music_8hpp_source.html">Music.hpp</a></li>
</ul>
</div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
</div>
</div>
</body>
</html>