<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Environmental Audio in Allegro5?</title>
		<link>http://www.allegro.cc/forums/view/618733</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 07 Oct 2022 23:20:32 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hey what&#39;s up.  Has anyone done some legwork on, or come across something related to real-time game audio processing using Allegro 5?  Allegro appears to have an impressive audio chain so it looks very possible.</p><p>I&#39;m looking specifically at being able to filter sound effect audio through a &quot;reverb&quot; filter, in a performant way, similar to Super Mario World when you enter an underground cave.  There are other applications for audio filtering that I&#39;d like to try out, too, but this is where I hope to start.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Sat, 24 Sep 2022 07:47:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I would recommend irrklang, it’s a really straightforward sound engine that allows you to use a bunch of different effects without much fuss, here’s a link with example of effects:</p><p><a href="https://www.ambiera.com/irrklang/tutorial-sound-effects.html">https://www.ambiera.com/irrklang/tutorial-sound-effects.html</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dizzy Egg)</author>
		<pubDate>Sat, 24 Sep 2022 15:29:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can also use OpenAL, it&#39;s a 3D audio library by KittyCat.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 24 Sep 2022 18:44:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can use <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_mixer_postprocess_callback"><span class="a">al_set_mixer_postprocess_callback</span></a><span class="k2">(</span><span class="k2">)</span></span> to process audio before it is sent to the audio device.</p><p>To do SNES-style reverb you could just keep a buffer of samples to be mixed in at a lower volume at an offset from when they were initially played. This is an oversimplification, of course, but it should point you in the right direction if you want to use Allegro for this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Mon, 03 Oct 2022 03:35:05 +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/618733/1052910#target">Todd Cope</a> said:</div><div class="quote"><p> You can use al_set_mixer_postprocess_callback() to process audio before it is sent to the audio device.<br /> To do SNES-style reverb you could just keep a buffer of samples to be mixed in at a lower volume at an offset from when they were initially played. This is an oversimplification, of course, but it should point you in the right direction if you want to use Allegro for this.</p></div></div><p>Thank you Todd, that was really good advice. I had initially abandoned that direction but thanks to your comment I continued and was able to make substantial progress.</p><p>Apparently, the actual math behind reverb is more than just one or two simple algorithms. There&#39;s art behind it, and one can craft many different kinds of reverb - it&#39;s somewhat analogous to writing an artistic shader. Working on this lead me down a path of <a href="https://en.wikipedia.org/wiki/Circular_buffer">circular buffers</a>, sample sizes, buffer lengths, channel configurations, all-pass filters, all these exciting things.  Apparently there&#39;s an <a href="https://www.theaudioprogrammer.com/">audio programming society</a> of people who specialize in audio programming and do that exclusively as a programming career, who knew! It&#39;s a very deep domain.</p><p>I found a nice youtube video <a href="https://www.youtube.com/watch?v=QWnD30xHjW4&amp;ab_channel=TheAudioProgrammer">&quot;Let&#39;s write a reverb&quot;</a>, which was a good talk on the subject.</p><p>At this point, I&#39;ve managed to write a solid circular buffer, a mixer, and a delay filter (with <span class="source-code">delay_sec</span> and <span class="source-code">decay</span>) that will be included it in my codebase.  With this much, I&#39;ve moved the ball forward and now have a good foundation for an actual reverb in the next steps.  Hopefully some exciting news coming up. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Fri, 07 Oct 2022 23:20:32 +0000</pubDate>
	</item>
</rss>
