<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Audio wont loop, audio freezes at end of stream (.ogg)</title>
		<link>http://www.allegro.cc/forums/view/606237</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 30 Jan 2011 06:13:40 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have some audio that is loaded from an .ogg file and played using loop mode. Here is my code that loads the audio and begins looping it:</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_restore_default_mixer"><span class="a">al_restore_default_mixer</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
    
    backgroundMusic <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_audio_stream_f"><span class="a">al_load_audio_stream_f</span></a><span class="k2">(</span>gameEngine::resources::audio.openSubFile<span class="k2">(</span><span class="s">":mainMenu:BGMusic.ogg"</span>, <span class="k1">false</span><span class="k2">)</span>,<span class="s">".ogg"</span>,<span class="n">200</span>,<span class="n">20</span><span class="k2">)</span><span class="k2">;</span>
    <a href="http://www.allegro.cc/manual/al_set_audio_stream_playmode"><span class="a">al_set_audio_stream_playmode</span></a><span class="k2">(</span>backgroundMusic,ALLEGRO_PLAYMODE_LOOP<span class="k2">)</span><span class="k2">;</span>
    <a href="http://www.allegro.cc/manual/al_attach_audio_stream_to_mixer"><span class="a">al_attach_audio_stream_to_mixer</span></a><span class="k2">(</span>backgroundMusic,<a href="http://www.allegro.cc/manual/al_get_default_mixer"><span class="a">al_get_default_mixer</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>


It plays fine, but when it gets to the end of the audio it should loop back to the beginning. Instead it freezes and keeps repeating a small fragment of the audio (eg. a broken record player sound, or the sound you hear when a CD player freezes).</p><p>Does anyone know why it won&#39;t loop? I&#39;ve also tried playing with the buffer count and samples on the al_load_audio_stream_f, but that didn&#39;t seem to change anything.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (TrieBr)</author>
		<pubDate>Sun, 30 Jan 2011 06:13:40 +0000</pubDate>
	</item>
</rss>
