<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Play sound from file in memory</title>
		<link>http://www.allegro.cc/forums/view/610861</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 19 Aug 2012 22:59:36 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m using <a>miniz</a> to load files from a .zip archive <i>into memory</i>. I&#39;m hoping to put my resources in this .zip and distribute it alongside my program. My question: Is it possible to use Allegro to play a sound file stored in memory, or will i have to resort to a separate audio library?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (nujuwhite)</author>
		<pubDate>Sun, 19 Aug 2012 11:08:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Allegro already supports loading files directly from zip files using the PhysFS addon... if you stick with miniz, however, you can use the memfile addon and then use the loading functions with the _f suffix.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sun, 19 Aug 2012 11:31:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>PhysFS seems too big and complicated... I think i&#39;ll use memfile and al_load_sample_f(). Thanks <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" /> So if i load the file into memory, will al_load_sample_f() duplicate it, or just read from what i&#39;ve already stored?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (nujuwhite)</author>
		<pubDate>Sun, 19 Aug 2012 11:48:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610861/963451#target">nujuwhite</a> said:</div><div class="quote"><p> So if i load the file into memory, will al_load_sample_f() duplicate it, or just read from what i&#39;ve already stored?</p></div></div><p>It will duplicate it (because it needs to decode it into the format Allegro uses to play sounds). If you don&#39;t want to duplicate, then look into the streaming API, e.g. <span class="source-code"><a href="http://www.allegro.cc/manual/al_load_audio_stream_f"><span class="a">al_load_audio_stream_f</span></a></span>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sun, 19 Aug 2012 11:53:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can stick with miniz and <span class="source-code"><a href="http://www.allegro.cc/manual/al_load_audio_stream"><span class="a">al_load_audio_stream</span></a></span> if you set up your own fshook driver.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610861/963451#target">nujuwhite</a> said:</div><div class="quote"><p>PhysFS seems too big and complicated...</p></div></div><p>Um, its like two or three PhysFS calls, and one allegro_physfs call. It&#39;s pretty easy, and you can stick things in zip files.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 19 Aug 2012 22:59:36 +0000</pubDate>
	</item>
</rss>
