<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Audio stuttering and slow</title>
		<link>http://www.allegro.cc/forums/view/606806</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 23 Mar 2011 02:32:25 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Is anyone else having problems with the allegro audio code? I&#39;m trying to play music but there&#39;s a slight stuttering noticable as well as it being played a fraction slower from what it ought to be. I have tried .mod and .flac audio files and it occurs with both so it&#39;s not specific to the dumb library.</p><p>I&#39;m using the allegro 5.0.1 precompiled binaries for windows because I can&#39;t get all the dependencies installed correctly myself.</p><p>Compiling on msvc 10.0 on windows 7 64-bit (compiling as 32-bit), using static linking. I have tried using the examples but those have the same audio problems so I don&#39;t think it&#39;s specific to my code.</p><p>Winamp ofcourse plays them fine and there&#39;s no absurd peak in processor resources or anything. I&#39;m kinda clueless about what could be going on.</p><p>Should I try to put the whole audio code in a seperate thread perhaps? I&#39;m new to windows programming so that&#39;d be a bit of a task to figure out but if it could help...<br />I&#39;m at a very early stage of testing/development so other then waiting for events, my main loop isn&#39;t doing much else.</p><p>The only thing improving things I found out so far is running the process at &#39;high priority&#39;. That makes it play full-speed and reduces the stuttering to near to 0. But I don&#39;t think that&#39;s a proper solution.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (senjin)</author>
		<pubDate>Tue, 22 Mar 2011 20:38:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What sound card / CPU do you have?</p><p>Try creating a file called allegro5.cfg (put it next to your exe) that looks like:
</p><pre>
[directsound]
buffer_size=8192
</pre><p>

Or, I think you can do this:
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/ALLEGRO_CONFIG"><span class="a">ALLEGRO_CONFIG</span></a> <span class="k3">*</span>cfg <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_system_config"><span class="a">al_get_system_config</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_set_config_value"><span class="a">al_set_config_value</span></a><span class="k2">(</span>cfg, <span class="s">"directsound"</span>, <span class="s">"buffer_size"</span>, <span class="s">"8192"</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
as long as you do that after initializing Allegro and before you initialize the audio addon.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 22 Mar 2011 22:36:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Soundcard: Soundblaster X-Fi Fatal1ty<br />Processor: AMD Athlon 64 3500+</p><p>Creating the allegro5.cfg improved things a great deal. I&#39;m still going to try the in-code version but so far things look good. The only time it stutters now is when I taskswitch or do other things while music is playing.</p><p>I thought the buffers in the al_load_audio_stream would accomplish a similar improvement, but changing those only made a tiny improvement and nothing major like the config file did.</p><p>Thanks for your help. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (senjin)</author>
		<pubDate>Wed, 23 Mar 2011 02:32:25 +0000</pubDate>
	</item>
</rss>
