<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[A5] How can I tell if a sample is currently playing?</title>
		<link>http://www.allegro.cc/forums/view/612596</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 16 May 2013 22:38:50 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Okay, I play a sample with the following example code...</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_play_sample"><span class="a">al_play_sample</span></a><span class="k2">(</span>sfx_mysound, setting.sound_volume, <span class="n">0</span>.<span class="n">0</span>, <span class="n">1</span>.<span class="n">0</span>, ALLEGRO_PLAYMODE_ONCE, NULL<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

is there a simple way to check if it is currently playing?</p><p>I know in Allegro 4 I used to use <span class="source-code"><a href="http://www.allegro.cc/manual/voice_get_position"><span class="a">voice_get_position</span></a><span class="k2">(</span><span class="k2">)</span></span> and I would check if it equaled -1 (wasn&#39;t currently playing) than I could play it again.</p><p>I&#39;m looking at various Allegro 5.1 functions for voice, sample instances etc... and I am not quite sure what I need to do.  Right now it&#39;s just a simple <span class="source-code"><a href="http://www.allegro.cc/manual/al_play_sample"><span class="a">al_play_sample</span></a><span class="k2">(</span><span class="k2">)</span></span>, but I get the feeling I need to do a lot more so I can check to see if it is currently playing.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Thu, 16 May 2013 22:27:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="source-code"><a href="http://www.allegro.cc/manual/al_get_sample_instance_playing"><span class="a">al_get_sample_instance_playing</span></a></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 16 May 2013 22:29:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oops, asked this once before, I just couldn&#39;t find it until now, sorry. :/
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Thu, 16 May 2013 22:38:50 +0000</pubDate>
	</item>
</rss>
