<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Sounds not playing repeating properly</title>
		<link>http://www.allegro.cc/forums/view/616771</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 01 Mar 2017 22:05:04 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hey there! I&#39;m trying to have my game play a gunshot every time a shot is fired, but the shots fire more frequently than the sound can play. Instead, the sound will allow itself the time to finish playing before repeating itself.</p><p>My current implementation is a vector of sample instances, and whenever I want to play them I just use <tt>al_play_sample_instance(m_sfx[track])</tt>. However, simply using that function won&#39;t allow the sound to be played multiple times on top of itself.</p><p>I&#39;ve tried reserving a larger numbers of samples and this seems to yield nothing. <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AgentBaron)</author>
		<pubDate>Mon, 27 Feb 2017 04:22:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You need more <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_SAMPLE_INSTANCE"><span class="a">ALLEGRO_SAMPLE_INSTANCE</span></a></span>&#39;s of an <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_SAMPLE"><span class="a">ALLEGRO_SAMPLE</span></a></span>.....</p><p><a href="https://www.allegro.cc/forums/thread/613153">Old post on samples</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dizzy Egg)</author>
		<pubDate>Mon, 27 Feb 2017 16:38:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;d like to add that there&#39;s a summary about the underlying concepts of the audio addon <a href="http://liballeg.org/a5docs/trunk/audio.html">here</a>, below the TOC. It&#39;s not in the a.cc version of the manual yet, as this is still 5.0.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Mon, 27 Feb 2017 21:09:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I feel like it needs a picture...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Tue, 28 Feb 2017 10:49:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There&#39;s a few sections of the Allegro 5 manual that could use tweaking. Like handling events and events using timers. I couldn&#39;t find any obvious usage of allegro timer causing an event, and in your event loop you check to ensure the timer is the correct one you&#39;re responding to. I just had to guess at the structure/comparison a few times until it finally worked. (Actually, on further inspection, I never figured it out. The line was commented out.)</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>
<span class="number">  2</span><a href="http://www.allegro.cc/manual/ALLEGRO_TIMER"><span class="a">ALLEGRO_TIMER</span></a> <span class="k3">*</span>fps_timer<span class="k2">;</span>
<span class="number">  3</span>
<span class="number">  4</span><span class="c">// ...</span>
<span class="number">  5</span>
<span class="number">  6</span><span class="k1">switch</span><span class="k2">(</span>event<span class="k2">)</span>
<span class="number">  7</span><span class="k2">{</span>
<span class="number">  8</span><span class="k1">case</span> ALLEGRO_EVENT_TIMER: <span class="c">//we have a timer</span>
<span class="number">  9</span>    <span class="k2">{</span>
<span class="number"> 10</span>    <span class="c">//is it the right timer?</span>
<span class="number"> 11</span>    <span class="k1">if</span><span class="k2">(</span>event.timer.source <span class="k3">=</span><span class="k3">=</span> fps_timer<span class="k2">)</span><span class="k2">{</span><span class="k2">}</span> <span class="c">//nope, this code isn't right. But it compiles.</span>
<span class="number"> 12</span>    <span class="k1">if</span><span class="k2">(</span>event.timer <span class="k3">=</span><span class="k3">=</span> fps_timer<span class="k2">)</span> <span class="c">//nope.</span>
<span class="number"> 13</span>    <span class="k1">if</span><span class="k2">(</span>event.timer.source <span class="k3">=</span><span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_timer_event_source"><span class="a">al_get_timer_event_source</span></a><span class="k2">(</span>fps_timer<span class="k2">)</span><span class="k2">)</span> <span class="c">//nope.</span>
<span class="number"> 14</span>     
<span class="number"> 15</span><span class="k2">}</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Tue, 28 Feb 2017 11:34:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/616771/1028708#target">Chris Katko</a> said:</div><div class="quote"><p> I couldn&#39;t find any obvious usage of allegro timer causing an event, and in your event loop you check to ensure the timer is the correct one you&#39;re responding to.</p></div></div><p>The first one is the correct one, and the last one will work if you do <span class="source-code">event.any.source</span> instead.</p><p>I made this picture for the manual, what do you guys think? It&#39;ll have some text attached to it but that&#39;s just adding to the 1000 words this adds, right?</p><p><span class="remote-thumbnail"><span class="json">{"name":"610805","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/c\/8c90f365a014deb6ebfd6d50a6e2f35b.png","w":757,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/c\/8c90f365a014deb6ebfd6d50a6e2f35b"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/8/c/8c90f365a014deb6ebfd6d50a6e2f35b-240.jpg" alt="610805" width="240" height="190" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Tue, 28 Feb 2017 11:58:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s a nice addition I say.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 28 Feb 2017 12:15:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/616771/1028709#target">SiegeLord</a> said:</div><div class="quote"><p>
The first one is the correct one, and the last one will work if you do event.any.source instead.
</p></div></div><p>
Thanks, again! I made a terrible mistake (and I&#39;m surprised the compiler didn&#39;t warn me...). I had a global fps_timer, and in haste/late-night change, I actually wrote:</p><p> ALLEGRO_TIMER *fps_timer = ... </p><p>in my initializing function, instead of </p><p>fps_timer = ...   </p><p>So I was actually creating a new local variable pointer (instead of referencing the global), setting up the timer, then letting that pointer disappear when the function returns while the global fps_timer was still set to null! </p><p>Ugh.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Tue, 28 Feb 2017 12:15:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s very nice. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>There&#39;s also ex_audio_chain. I&#39;m not sure whether the docs reference any examples at all, though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Wed, 01 Mar 2017 01:28:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Mentioning the example is a good idea, but I think it should be done more generally. It probably isn&#39;t too difficult to replica what allegro.cc has and just link every example an API entry appears on.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 01 Mar 2017 11:16:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That would be cool, although every example will call al_init and at least many of them will have some sort of event loop.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Wed, 01 Mar 2017 22:05:04 +0000</pubDate>
	</item>
</rss>
