summaryrefslogtreecommitdiff
path: root/doc/html/classsf_1_1SoundStream.htm
blob: 391f34cb479a0aefcc2a433f8e87f24941575ffb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="tabs.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <div id="logo">
            <img src="./logo.jpg" width="770" height="200" title="SFML home" alt="SFML logo" />
        </div>
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="index.htm"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.htm"><span>Namespaces</span></a></li>
    <li class="current"><a href="classes.htm"><span>Classes</span></a></li>
    <li><a href="files.htm"><span>Files</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="classes.htm"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.htm"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.htm"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.htm"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<div class="nav">
<a class="el" href="namespacesf.htm">sf</a>::<a class="el" href="classsf_1_1SoundStream.htm">SoundStream</a></div>
<h1>sf::SoundStream Class Reference</h1><!-- doxytag: class="sf::SoundStream" --><!-- doxytag: inherits="sf::Thread,sf::Sound" --><a class="el" href="classsf_1_1SoundStream.htm" title="SoundStream is a streamed sound, ie samples are acquired while the sound is playing...">SoundStream</a> is a streamed sound, ie samples are acquired while the sound is playing.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="SoundStream_8hpp-source.htm">SoundStream.hpp</a>&gt;</code>
<p>
<p>Inheritance diagram for sf::SoundStream:
<p><center><img src="classsf_1_1SoundStream.png" usemap="#sf::SoundStream_map" border="0" alt=""></center>
<map name="sf::SoundStream_map">
<area href="classsf_1_1Thread.htm" alt="sf::Thread" shape="rect" coords="0,0,103,24">
<area href="classsf_1_1Sound.htm" alt="sf::Sound" shape="rect" coords="113,0,216,24">
<area href="classsf_1_1Music.htm" alt="sf::Music" shape="rect" coords="56,112,159,136">
</map>
<a href="classsf_1_1SoundStream-members.htm">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.htm#1fafb9f1ca572d23d7d6a17921860d85">~SoundStream</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual destructor.  <a href="#1fafb9f1ca572d23d7d6a17921860d85"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.htm#4d8437ef9a952fe3798bd239ff20d9bf">Play</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start playing the audio stream.  <a href="#4d8437ef9a952fe3798bd239ff20d9bf"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.htm#53c9e9b160bcbcc89c93c1682b4525df">Stop</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop playing the audio stream.  <a href="#53c9e9b160bcbcc89c93c1682b4525df"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.htm#fb9692455fa3a358691eb600d7570ed8">GetChannelsCount</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of channels (1 = mono, 2 = stereo).  <a href="#fb9692455fa3a358691eb600d7570ed8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.htm#8a14601b49a6dfdbc1de886a4d677e1b">GetSampleRate</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the stream sample rate.  <a href="#8a14601b49a6dfdbc1de886a4d677e1b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classsf_1_1Sound.htm#28ad2186cde78fed2c79c867b9622195">Status</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.htm#308ef2a984db4cfd0b8e1bf8b1e8e4c0">GetStatus</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the status of the stream (stopped, paused, playing).  <a href="#308ef2a984db4cfd0b8e1bf8b1e8e4c0"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.htm#769d08f4c3c6b4340ef3a838329d2e5c">SoundStream</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor.  <a href="#769d08f4c3c6b4340ef3a838329d2e5c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1SoundStream.htm#ed9b6b06c0fa9c2d0b8c094eb2826793">Initialize</a> (unsigned int ChannelsCount, unsigned int SampleRate)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the audio stream parameters, you must call it before <a class="el" href="classsf_1_1SoundStream.htm#4d8437ef9a952fe3798bd239ff20d9bf" title="Start playing the audio stream.">Play()</a>.  <a href="#ed9b6b06c0fa9c2d0b8c094eb2826793"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsf_1_1SoundStream_1_1Chunk.htm">Chunk</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Structure defining a chunk of audio data to stream.  <a href="structsf_1_1SoundStream_1_1Chunk.htm#_details">More...</a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classsf_1_1SoundStream.htm" title="SoundStream is a streamed sound, ie samples are acquired while the sound is playing...">SoundStream</a> is a streamed sound, ie samples are acquired while the sound is playing. 
<p>
Use it for big sounds that would require hundreds of MB in memory (see sfMusic), or for streaming sound from the network 
<p>

<p>
Definition at line <a class="el" href="SoundStream_8hpp-source.htm#l00044">44</a> of file <a class="el" href="SoundStream_8hpp-source.htm">SoundStream.hpp</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="1fafb9f1ca572d23d7d6a17921860d85"></a><!-- doxytag: member="sf::SoundStream::~SoundStream" ref="1fafb9f1ca572d23d7d6a17921860d85" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual sf::SoundStream::~SoundStream           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Virtual destructor. 
<p>

</div>
</div><p>
<a class="anchor" name="769d08f4c3c6b4340ef3a838329d2e5c"></a><!-- doxytag: member="sf::SoundStream::SoundStream" ref="769d08f4c3c6b4340ef3a838329d2e5c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sf::SoundStream::SoundStream           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Default constructor. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="4d8437ef9a952fe3798bd239ff20d9bf"></a><!-- doxytag: member="sf::SoundStream::Play" ref="4d8437ef9a952fe3798bd239ff20d9bf" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::SoundStream::Play           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Start playing the audio stream. 
<p>

<p>
Reimplemented from <a class="el" href="classsf_1_1Sound.htm#fdafa7970587f04d3833b4095c2de1db">sf::Sound</a>.
</div>
</div><p>
<a class="anchor" name="53c9e9b160bcbcc89c93c1682b4525df"></a><!-- doxytag: member="sf::SoundStream::Stop" ref="53c9e9b160bcbcc89c93c1682b4525df" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::SoundStream::Stop           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Stop playing the audio stream. 
<p>

<p>
Reimplemented from <a class="el" href="classsf_1_1Sound.htm#b1f5f103f737c52ceb0b1a067b4d0630">sf::Sound</a>.
</div>
</div><p>
<a class="anchor" name="fb9692455fa3a358691eb600d7570ed8"></a><!-- doxytag: member="sf::SoundStream::GetChannelsCount" ref="fb9692455fa3a358691eb600d7570ed8" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int sf::SoundStream::GetChannelsCount           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return the number of channels (1 = mono, 2 = stereo). 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Number of channels </dd></dl>

</div>
</div><p>
<a class="anchor" name="8a14601b49a6dfdbc1de886a4d677e1b"></a><!-- doxytag: member="sf::SoundStream::GetSampleRate" ref="8a14601b49a6dfdbc1de886a4d677e1b" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int sf::SoundStream::GetSampleRate           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the stream sample rate. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Stream frequency (number of samples per second) </dd></dl>

</div>
</div><p>
<a class="anchor" name="308ef2a984db4cfd0b8e1bf8b1e8e4c0"></a><!-- doxytag: member="sf::SoundStream::GetStatus" ref="308ef2a984db4cfd0b8e1bf8b1e8e4c0" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Sound.htm#28ad2186cde78fed2c79c867b9622195">Status</a> sf::SoundStream::GetStatus           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the status of the stream (stopped, paused, playing). 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Current status of the sound </dd></dl>

<p>
Reimplemented from <a class="el" href="classsf_1_1Sound.htm#c2ffc93f9ffaddc50b9c9adb75581b55">sf::Sound</a>.
</div>
</div><p>
<a class="anchor" name="ed9b6b06c0fa9c2d0b8c094eb2826793"></a><!-- doxytag: member="sf::SoundStream::Initialize" ref="ed9b6b06c0fa9c2d0b8c094eb2826793" args="(unsigned int ChannelsCount, unsigned int SampleRate)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::SoundStream::Initialize           </td>
          <td>(</td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>ChannelsCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>SampleRate</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the audio stream parameters, you must call it before <a class="el" href="classsf_1_1SoundStream.htm#4d8437ef9a952fe3798bd239ff20d9bf" title="Start playing the audio stream.">Play()</a>. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ChannelsCount</em>&nbsp;</td><td>: Number of channels </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>SampleRate</em>&nbsp;</td><td>: Sample rate </td></tr>
  </table>
</dl>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="SoundStream_8hpp-source.htm">SoundStream.hpp</a></ul>

        <p id="footer">
            &nbsp;::&nbsp; Copyright &copy; 2007-2008 Laurent Gomila, all rights reserved &nbsp;::&nbsp;
            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.5.2</a> &nbsp;::&nbsp;
        </p>

    </body>
</html>