<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Problem loading audio stream from tracker music file</title>
		<link>http://www.allegro.cc/forums/view/616738</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 13 Feb 2017 08:35:53 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello, I&#39;m a newcomer to Allegro and I&#39;m trying to play an .xm music file with the following code: </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><a href="http://www.allegro.cc/manual/ALLEGRO_AUDIO_STREAM"><span class="a">ALLEGRO_AUDIO_STREAM</span></a> <span class="k3">*</span>stream <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_audio_stream"><span class="a">al_load_audio_stream</span></a><span class="k2">(</span><span class="s">"path/to/file.xm"</span>, <span class="n">4</span>, <span class="n">2048</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 2</span><span class="k1">if</span> <span class="k2">(</span>stream<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 3</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>stream, ALLEGRO_PLAYMODE_LOOP<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 4</span>    <a href="http://www.allegro.cc/manual/al_set_audio_stream_playing"><span class="a">al_set_audio_stream_playing</span></a><span class="k2">(</span>stream, <span class="k1">true</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 5</span><span class="k2">}</span>
<span class="number"> 6</span><span class="k1">else</span> <span class="k2">{</span>
<span class="number"> 7</span>    <span class="c">// panic!</span>
<span class="number"> 8</span><span class="k2">}</span>
</div></div><p>
The problem is,<tt> al_load_audio_stream </tt>is returning <tt> NULL</tt>. I know the file path is correct and I know the audio and acodec Allegro addons are both working because I am able to load and play .wav samples. I understand Allegro 5 uses DUMB to play module files like .xm, and I have the DUMB library installed. Do I need to #include anything or link anything beyond the audio and acodec libraries in order to load and play .xm files? I haven&#39;t been able to find any full code examples with this specific format so I&#39;m a little bit lost.</p><p>Additionally, I&#39;m not really sure what the second and third parameters of<tt> al_load_audio_stream </tt>are supposed to be (number of buffers and number of samples, respectively), so I just used values I saw other people using in posts online. Could this be the source of the issue, and if so, how do I determine which values to use with the music file I want?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (mm2dog)</author>
		<pubDate>Mon, 13 Feb 2017 07:39:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What OS is this?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 13 Feb 2017 08:15:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry, I forgot to mention. I am on Arch linux
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (mm2dog)</author>
		<pubDate>Mon, 13 Feb 2017 08:20:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The Arch package doesn&#39;t build Allegro with the DUMB dependency (see <a href="https://github.com/liballeg/allegro5/issues/670#issuecomment-251003473">https://github.com/liballeg/allegro5/issues/670#issuecomment-251003473</a> for the explanation). You&#39;ll have to build Allegro yourself. Just install these dependencies manually (<a href="https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/allegro#n14">https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/allegro#n14</a>), in addition to dumb, and then follow the usual build instructions (see further below in that PKGBUILD file).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 13 Feb 2017 08:32:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m a little ashamed I didn&#39;t find that issue on github with my googling. Thanks for your help!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (mm2dog)</author>
		<pubDate>Mon, 13 Feb 2017 08:35:53 +0000</pubDate>
	</item>
</rss>
