<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[Audio] How to play a sound n times in A5?</title>
		<link>http://www.allegro.cc/forums/view/607720</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 30 Jun 2011 20:31:11 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How to play a sample and/or an audio stream n times in A5?<br />I mean play it eg. 5 times then stop.</p><p>possible solution are:<br />1. listen the play complete event<br />2. get audio length and use a timer</p><p>the 1 solution seems not supported in A5 now.<br />the 2 solution works in A5.</p><p>My question is: <br />1. is there any better solution?<br />2. how can i listen the play complete event? (I need this not only for repeating but also for user callback)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xpolife)</author>
		<pubDate>Thu, 30 Jun 2011 06:51:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Create sample instances and use the functions associated with sample instances to play it. You can then use <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 class="k2">(</span>...<span class="k2">)</span></span> to check if it&#39;s still playing.</p><p>Manual page for your convenience: <a href="http://www.allegro.cc/manual/5/audio.html">Audio Routines</a> (Scroll down a bit for sample instance functions)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (someone972)</author>
		<pubDate>Thu, 30 Jun 2011 07:19:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for replying.</p><p>And I think the al_get_sample_instance_playing() is a polling manner,<br />that is i have keeps check it.</p><p>I&#39;d prefer the event notify manner if possible.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xpolife)</author>
		<pubDate>Thu, 30 Jun 2011 08:07:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I haven&#39;t seen anything that outputs an event when a sample stops, but I haven&#39;t really been playing sounds so I can&#39;t be sure. If you really want an event you could create a user event and send that, but you would still need to poll the sample.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (someone972)</author>
		<pubDate>Thu, 30 Jun 2011 19:57:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>For streams I know there is:</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>If the stream is created by al_load_audio_stream then it can also generate an ALLEGRO_EVENT_AUDIO_STREAM_FINISHED event if it reaches the end of the file and is not set to loop.</p></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Thu, 30 Jun 2011 20:31:11 +0000</pubDate>
	</item>
</rss>
