Imported Upstream version 1.2
[platform/upstream/alure.git] / docs / html / files / stream-cpp.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
2
3 <html><head><title>Streaming - ALURE</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
4 if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
5
6 <!--  Generated by Natural Docs, version 1.4 -->
7 <!--  http://www.naturaldocs.org  -->
8
9 <!-- saved from url=(0026)http://www.naturaldocs.org -->
10
11
12
13
14 <div id=Content><div class="CSection"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Streaming"></a>Streaming</h1><div class=CBody><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#Streaming" >Streaming</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#alureStreamSizeIsMicroSec" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">alureStreamSizeIsMicroSec</a></td><td class=SDescription>Specifies if the chunk size value given to the alureCreateStream functions is in bytes (default) or microseconds. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#alureCreateStreamFromFile" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">alureCreateStreamFromFile</a></td><td class=SDescription>Opens a file and sets it up for streaming. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#alureCreateStreamFromMemory" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">alureCreateStreamFromMemory</a></td><td class=SDescription>Opens a file image from memory and sets it up for streaming, similar to <a href="#alureCreateStreamFromFile" class=LFunction id=link4 onMouseOver="ShowTip(event, 'tt2', 'link4')" onMouseOut="HideTip('tt2')">alureCreateStreamFromFile</a>. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#alureCreateStreamFromStaticMemory" id=link5 onMouseOver="ShowTip(event, 'tt4', 'link5')" onMouseOut="HideTip('tt4')">alureCreateStreamFromStaticMemory</a></td><td class=SDescription>Identical to <a href="#alureCreateStreamFromMemory" class=LFunction id=link6 onMouseOver="ShowTip(event, 'tt3', 'link6')" onMouseOut="HideTip('tt3')">alureCreateStreamFromMemory</a>, except the given memory is used directly and not duplicated. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#alureCreateStreamFromCallback" id=link7 onMouseOver="ShowTip(event, 'tt5', 'link7')" onMouseOut="HideTip('tt5')">alureCreateStreamFromCallback</a></td><td class=SDescription>Creates a stream using the specified callback to retrieve data. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#alureGetStreamFrequency" id=link8 onMouseOver="ShowTip(event, 'tt6', 'link8')" onMouseOut="HideTip('tt6')">alureGetStreamFrequency</a></td><td class=SDescription>Retrieves the frequency used by the given stream.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#alureBufferDataFromStream" id=link9 onMouseOver="ShowTip(event, 'tt7', 'link9')" onMouseOut="HideTip('tt7')">alureBufferDataFromStream</a></td><td class=SDescription>Buffers the given buffer objects with the next chunks of data from the stream. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#alureRewindStream" id=link10 onMouseOver="ShowTip(event, 'tt8', 'link10')" onMouseOut="HideTip('tt8')">alureRewindStream</a></td><td class=SDescription>Rewinds the stream so that the next alureBufferDataFromStream call will restart from the beginning of the audio file.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#alureSetStreamOrder" id=link11 onMouseOver="ShowTip(event, 'tt9', 'link11')" onMouseOut="HideTip('tt9')">alureSetStreamOrder</a></td><td class=SDescription>Skips the module decoder to the specified order, so following buffering calls will decode from the specified order. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#alureSetStreamPatchset" id=link12 onMouseOver="ShowTip(event, 'tt10', 'link12')" onMouseOut="HideTip('tt10')">alureSetStreamPatchset</a></td><td class=SDescription>Specifies the patchset to use for MIDI streams. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#alureGetStreamLength" id=link13 onMouseOver="ShowTip(event, 'tt11', 'link13')" onMouseOut="HideTip('tt11')">alureGetStreamLength</a></td><td class=SDescription>Retrieves an approximate number of samples for the stream. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#alureDestroyStream" id=link14 onMouseOver="ShowTip(event, 'tt12', 'link14')" onMouseOut="HideTip('tt12')">alureDestroyStream</a></td><td class=SDescription>Closes an opened stream. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
15
16 <div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Functions"></a>Functions</h3></div></div>
17
18 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureStreamSizeIsMicroSec"></a>alureStreamSizeIsMicroSec</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALboolean ALURE_APIENTRY alureStreamSizeIsMicroSec(</td><td class=PType nowrap>ALboolean&nbsp;</td><td class=PParameter nowrap>useUS</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Specifies if the chunk size value given to the alureCreateStream functions is in bytes (default) or microseconds.&nbsp; Specifying the size in microseconds can help manage the time needed in between needed updates (since the format and sample rate of the stream may not be known), while specifying the size in bytes can help control memory usage.</p><h4 class=CHeading>Returns</h4><p>Previously set value.</p><p><b>Version Added</b>: 1.1</p><h4 class=CHeading>See Also</h4><p><a href="#alureCreateStreamFromFile" class=LFunction id=link15 onMouseOver="ShowTip(event, 'tt2', 'link15')" onMouseOut="HideTip('tt2')">alureCreateStreamFromFile</a>, <a href="#alureCreateStreamFromMemory" class=LFunction id=link16 onMouseOver="ShowTip(event, 'tt3', 'link16')" onMouseOut="HideTip('tt3')">alureCreateStreamFromMemory</a>, <a href="#alureCreateStreamFromStaticMemory" class=LFunction id=link17 onMouseOver="ShowTip(event, 'tt4', 'link17')" onMouseOut="HideTip('tt4')">alureCreateStreamFromStaticMemory</a>, <a href="#alureCreateStreamFromCallback" class=LFunction id=link18 onMouseOver="ShowTip(event, 'tt5', 'link18')" onMouseOut="HideTip('tt5')">alureCreateStreamFromCallback</a></p></div></div></div>
19
20 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureCreateStreamFromFile"></a>alureCreateStreamFromFile</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>ALURE_API alureStream* ALURE_APIENTRY alureCreateStreamFromFile(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>ALchar&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>fname,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>chunkLength,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>numBufs,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>bufs</td></tr><tr><td class=PAfterParameters colspan=5>)</td></tr></table></td></tr></table></blockquote><p>Opens a file and sets it up for streaming.&nbsp; The given chunkLength is the number of bytes, or microseconds worth of bytes if <a href="#alureStreamSizeIsMicroSec" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt1', 'link19')" onMouseOut="HideTip('tt1')">alureStreamSizeIsMicroSec</a> was last called with AL_TRUE, each buffer will fill with.&nbsp; ALURE will optionally generate the specified number of buffer objects, fill them with the beginning of the data, then place the new IDs into the provided storage, before returning.&nbsp; Requires an active context.</p><h4 class=CHeading>Returns</h4><p>An opaque handle used to control the opened stream, or NULL on error.</p><h4 class=CHeading>See Also</h4><p><a href="#alureStreamSizeIsMicroSec" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt1', 'link20')" onMouseOut="HideTip('tt1')">alureStreamSizeIsMicroSec</a>, <a href="#alureCreateStreamFromMemory" class=LFunction id=link21 onMouseOver="ShowTip(event, 'tt3', 'link21')" onMouseOut="HideTip('tt3')">alureCreateStreamFromMemory</a>, <a href="#alureCreateStreamFromStaticMemory" class=LFunction id=link22 onMouseOver="ShowTip(event, 'tt4', 'link22')" onMouseOut="HideTip('tt4')">alureCreateStreamFromStaticMemory</a>, <a href="#alureCreateStreamFromCallback" class=LFunction id=link23 onMouseOver="ShowTip(event, 'tt5', 'link23')" onMouseOut="HideTip('tt5')">alureCreateStreamFromCallback</a></p></div></div></div>
21
22 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureCreateStreamFromMemory"></a>alureCreateStreamFromMemory</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>ALURE_API alureStream* ALURE_APIENTRY alureCreateStreamFromMemory(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>ALubyte&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>fdata,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>length,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>chunkLength,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>numBufs,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>bufs</td></tr><tr><td class=PAfterParameters colspan=5>)</td></tr></table></td></tr></table></blockquote><p>Opens a file image from memory and sets it up for streaming, similar to <a href="#alureCreateStreamFromFile" class=LFunction id=link24 onMouseOver="ShowTip(event, 'tt2', 'link24')" onMouseOut="HideTip('tt2')">alureCreateStreamFromFile</a>.&nbsp; The given data buffer can be safely deleted after calling this function.&nbsp; Requires an active context.</p><h4 class=CHeading>Returns</h4><p>An opaque handle used to control the opened stream, or NULL on error.</p><h4 class=CHeading>See Also</h4><p><a href="#alureStreamSizeIsMicroSec" class=LFunction id=link25 onMouseOver="ShowTip(event, 'tt1', 'link25')" onMouseOut="HideTip('tt1')">alureStreamSizeIsMicroSec</a>, <a href="#alureCreateStreamFromFile" class=LFunction id=link26 onMouseOver="ShowTip(event, 'tt2', 'link26')" onMouseOut="HideTip('tt2')">alureCreateStreamFromFile</a>, <a href="#alureCreateStreamFromStaticMemory" class=LFunction id=link27 onMouseOver="ShowTip(event, 'tt4', 'link27')" onMouseOut="HideTip('tt4')">alureCreateStreamFromStaticMemory</a>, <a href="#alureCreateStreamFromCallback" class=LFunction id=link28 onMouseOver="ShowTip(event, 'tt5', 'link28')" onMouseOut="HideTip('tt5')">alureCreateStreamFromCallback</a></p></div></div></div>
23
24 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureCreateStreamFromStaticMemory"></a>alureCreateStreamFromStaticMemory</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>ALURE_API alureStream* ALURE_APIENTRY alureCreateStreamFromStaticMemory(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>ALubyte&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>fdata,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>length,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>chunkLength,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>numBufs,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>bufs</td></tr><tr><td class=PAfterParameters colspan=5>)</td></tr></table></td></tr></table></blockquote><p>Identical to <a href="#alureCreateStreamFromMemory" class=LFunction id=link29 onMouseOver="ShowTip(event, 'tt3', 'link29')" onMouseOut="HideTip('tt3')">alureCreateStreamFromMemory</a>, except the given memory is used directly and not duplicated.&nbsp; As a consequence, the data buffer must remain valid while the stream is alive.&nbsp; Requires an active context.</p><h4 class=CHeading>Returns</h4><p>An opaque handle used to control the opened stream, or NULL on error.</p><h4 class=CHeading>See Also</h4><p><a href="#alureStreamSizeIsMicroSec" class=LFunction id=link30 onMouseOver="ShowTip(event, 'tt1', 'link30')" onMouseOut="HideTip('tt1')">alureStreamSizeIsMicroSec</a>, <a href="#alureCreateStreamFromFile" class=LFunction id=link31 onMouseOver="ShowTip(event, 'tt2', 'link31')" onMouseOut="HideTip('tt2')">alureCreateStreamFromFile</a>, <a href="#alureCreateStreamFromMemory" class=LFunction id=link32 onMouseOver="ShowTip(event, 'tt3', 'link32')" onMouseOut="HideTip('tt3')">alureCreateStreamFromMemory</a>, <a href="#alureCreateStreamFromCallback" class=LFunction id=link33 onMouseOver="ShowTip(event, 'tt5', 'link33')" onMouseOut="HideTip('tt5')">alureCreateStreamFromCallback</a></p></div></div></div>
25
26 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureCreateStreamFromCallback"></a>alureCreateStreamFromCallback</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=4>ALURE_API alureStream* ALURE_APIENTRY alureCreateStreamFromCallback(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>(*callback)(void *userdata, ALubyte *data, ALuint bytes),</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>userdata,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALenum&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>format,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>samplerate,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>chunkLength,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>numBufs,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>bufs</td></tr><tr><td class=PAfterParameters colspan=4>)</td></tr></table></td></tr></table></blockquote><p>Creates a stream using the specified callback to retrieve data.&nbsp; Requires an active context.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>callback</td><td class=CDLDescription>This is called when more data is needed from the stream.&nbsp; Up to the specified number of bytes should be written to the data pointer, and the number of bytes actually written should be returned.&nbsp; The number of bytes written must be block aligned for the format (eg. a multiple of 4 for AL_FORMAT_STEREO16), or an OpenAL error may occur during buffering.</td></tr><tr><td class=CDLEntry>userdata</td><td class=CDLDescription>A handle passed through to the callback.</td></tr><tr><td class=CDLEntry>format</td><td class=CDLDescription>The format of the data the callback will be giving.&nbsp; The format must be valid for the context.</td></tr><tr><td class=CDLEntry>samplerate</td><td class=CDLDescription>The sample rate (frequency) of the stream</td></tr></table><h4 class=CHeading>Returns</h4><p>An opaque handle used to control the opened stream, or NULL on error.</p><h4 class=CHeading>See Also</h4><p><a href="#alureStreamSizeIsMicroSec" class=LFunction id=link34 onMouseOver="ShowTip(event, 'tt1', 'link34')" onMouseOut="HideTip('tt1')">alureStreamSizeIsMicroSec</a>, <a href="#alureCreateStreamFromFile" class=LFunction id=link35 onMouseOver="ShowTip(event, 'tt2', 'link35')" onMouseOut="HideTip('tt2')">alureCreateStreamFromFile</a>, <a href="#alureCreateStreamFromMemory" class=LFunction id=link36 onMouseOver="ShowTip(event, 'tt3', 'link36')" onMouseOut="HideTip('tt3')">alureCreateStreamFromMemory</a>, <a href="#alureCreateStreamFromStaticMemory" class=LFunction id=link37 onMouseOver="ShowTip(event, 'tt4', 'link37')" onMouseOut="HideTip('tt4')">alureCreateStreamFromStaticMemory</a></p></div></div></div>
27
28 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureGetStreamFrequency"></a>alureGetStreamFrequency</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALsizei ALURE_APIENTRY alureGetStreamFrequency(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Retrieves the frequency used by the given stream.</p><h4 class=CHeading>Returns</h4><p>0 on error.</p><p><b>Version Added</b>: 1.1</p></div></div></div>
29
30 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureBufferDataFromStream"></a>alureBufferDataFromStream</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALsizei ALURE_APIENTRY alureBufferDataFromStream(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream,</td></tr><tr><td></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>numBufs,</td></tr><tr><td></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>bufs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Buffers the given buffer objects with the next chunks of data from the stream.&nbsp; The given buffer objects do not need to be ones given by the alureCreateStream functions.&nbsp; Requires an active context.</p><h4 class=CHeading>Returns</h4><p>The number of buffers filled with new data, or -1 on error.&nbsp; If the value returned is less than the number requested, the end of the stream has been reached.</p></div></div></div>
31
32 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureRewindStream"></a>alureRewindStream</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALboolean ALURE_APIENTRY alureRewindStream(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Rewinds the stream so that the next alureBufferDataFromStream call will restart from the beginning of the audio file.</p><h4 class=CHeading>Returns</h4><p>AL_FALSE on error.</p><h4 class=CHeading>See Also</h4><p><a href="#alureSetStreamOrder" class=LFunction id=link38 onMouseOver="ShowTip(event, 'tt9', 'link38')" onMouseOut="HideTip('tt9')">alureSetStreamOrder</a></p></div></div></div>
33
34 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureSetStreamOrder"></a>alureSetStreamOrder</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALboolean ALURE_APIENTRY alureSetStreamOrder(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream,</td></tr><tr><td></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>order</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Skips the module decoder to the specified order, so following buffering calls will decode from the specified order.&nbsp; For non-module formats, setting order 0 is identical to rewinding the stream (other orders will fail).</p><h4 class=CHeading>Returns</h4><p>AL_FALSE on error.</p><p><b>Version Added</b>: 1.1</p><h4 class=CHeading>See Also</h4><p><a href="#alureRewindStream" class=LFunction id=link39 onMouseOver="ShowTip(event, 'tt8', 'link39')" onMouseOut="HideTip('tt8')">alureRewindStream</a></p></div></div></div>
35
36 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureSetStreamPatchset"></a>alureSetStreamPatchset</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>ALURE_API ALboolean ALURE_APIENTRY alureSetStreamPatchset(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>stream,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>ALchar&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>patchset</td></tr><tr><td class=PAfterParameters colspan=5>)</td></tr></table></td></tr></table></blockquote><p>Specifies the patchset to use for MIDI streams.&nbsp; By default, the FluidSynth decoder will look for one in the FLUID_SOUNDFONT environment variable, but this can be used to change it to something different.&nbsp; On non-MIDI streams, this has no effect.</p><h4 class=CHeading>Returns</h4><p>AL_FALSE on error.</p><p><b>Version Added</b>: 1.1</p></div></div></div>
37
38 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureGetStreamLength"></a>alureGetStreamLength</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API alureInt64 ALURE_APIENTRY alureGetStreamLength(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Retrieves an approximate number of samples for the stream.&nbsp; Not all streams or decoders can return such info, and may return 0 if the stream length is unknown.</p><h4 class=CHeading>Returns</h4><p>-1 on error.</p><p><b>Version Added</b>: 1.2</p></div></div></div>
39
40 <div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="alureDestroyStream"></a>alureDestroyStream</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALboolean ALURE_APIENTRY alureDestroyStream(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream,</td></tr><tr><td></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>numBufs,</td></tr><tr><td></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>bufs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Closes an opened stream.&nbsp; For convenience, it will also delete the given buffer objects.&nbsp; The given buffer objects do not need to be ones given by the alureCreateStream functions.&nbsp; Requires an active context.</p><h4 class=CHeading>Returns</h4><p>AL_FALSE on error.</p></div></div></div>
41
42 </div><!--Content-->
43
44
45 <div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
46
47
48 <div id=Menu><div class=MTitle>ALURE<div class=MSubTitle>API Reference</div></div><div class=MEntry><div class=MFile><a href="alure-cpp.html">Main and Miscellanious</a></div></div><div class=MEntry><div class=MFile><a href="buffer-cpp.html">File Loading</a></div></div><div class=MEntry><div class=MFile id=MSelected>Streaming</div></div><div class=MEntry><div class=MFile><a href="istream-cpp.html">File I/<wbr>O</a></div></div><div class=MEntry><div class=MFile><a href="streamplay-cpp.html">Automatic Playback</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div></div></div></div><script type="text/javascript"><!--
49 var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
50 --></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Functions">Functions</option></select></div></div><!--Menu-->
51
52
53
54 <!--START_ND_TOOLTIPS-->
55 <div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALboolean ALURE_APIENTRY alureStreamSizeIsMicroSec(</td><td class=PType nowrap>ALboolean&nbsp;</td><td class=PParameter nowrap>useUS</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Specifies if the chunk size value given to the alureCreateStream functions is in bytes (default) or microseconds. </div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>ALURE_API alureStream* ALURE_APIENTRY alureCreateStreamFromFile(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>ALchar&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>fname,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>chunkLength,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>numBufs,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>bufs</td></tr><tr><td class=PAfterParameters colspan=5>)</td></tr></table></td></tr></table></blockquote>Opens a file and sets it up for streaming. </div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>ALURE_API alureStream* ALURE_APIENTRY alureCreateStreamFromMemory(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>ALubyte&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>fdata,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>length,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>chunkLength,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>numBufs,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>bufs</td></tr><tr><td class=PAfterParameters colspan=5>)</td></tr></table></td></tr></table></blockquote>Opens a file image from memory and sets it up for streaming, similar to alureCreateStreamFromFile. </div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>ALURE_API alureStream* ALURE_APIENTRY alureCreateStreamFromStaticMemory(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>ALubyte&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>fdata,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>length,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>chunkLength,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>numBufs,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>bufs</td></tr><tr><td class=PAfterParameters colspan=5>)</td></tr></table></td></tr></table></blockquote>Identical to alureCreateStreamFromMemory, except the given memory is used directly and not duplicated. </div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=4>ALURE_API alureStream* ALURE_APIENTRY alureCreateStreamFromCallback(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>(*callback)(void *userdata, ALubyte *data, ALuint bytes),</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>void&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>userdata,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALenum&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>format,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>samplerate,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>chunkLength,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap width=100%>numBufs,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>bufs</td></tr><tr><td class=PAfterParameters colspan=4>)</td></tr></table></td></tr></table></blockquote>Creates a stream using the specified callback to retrieve data. </div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALsizei ALURE_APIENTRY alureGetStreamFrequency(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Retrieves the frequency used by the given stream.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALsizei ALURE_APIENTRY alureBufferDataFromStream(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream,</td></tr><tr><td></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>numBufs,</td></tr><tr><td></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>bufs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Buffers the given buffer objects with the next chunks of data from the stream. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALboolean ALURE_APIENTRY alureRewindStream(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Rewinds the stream so that the next alureBufferDataFromStream call will restart from the beginning of the audio file.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALboolean ALURE_APIENTRY alureSetStreamOrder(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream,</td></tr><tr><td></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>order</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Skips the module decoder to the specified order, so following buffering calls will decode from the specified order. </div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>ALURE_API ALboolean ALURE_APIENTRY alureSetStreamPatchset(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap></td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>stream,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class=PTypePrefix nowrap>const&nbsp;</td><td class=PType nowrap>ALchar&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap width=100%>patchset</td></tr><tr><td class=PAfterParameters colspan=5>)</td></tr></table></td></tr></table></blockquote>Specifies the patchset to use for MIDI streams. </div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API alureInt64 ALURE_APIENTRY alureGetStreamLength(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Retrieves an approximate number of samples for the stream. </div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>ALURE_API ALboolean ALURE_APIENTRY alureDestroyStream(</td><td class=PType nowrap>alureStream&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>stream,</td></tr><tr><td></td><td class=PType nowrap>ALsizei&nbsp;</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>numBufs,</td></tr><tr><td></td><td class=PType nowrap>ALuint&nbsp;</td><td class=PParameterPrefix nowrap>*</td><td class=PParameter nowrap>bufs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Closes an opened stream. </div></div><!--END_ND_TOOLTIPS-->
56
57
58
59
60 <div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
61
62
63 <script language=JavaScript><!--
64 if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>