<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Fmod Spectrum problems</title>
		<link>http://www.allegro.cc/forums/view/594955</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 02 Feb 2008 15:36:28 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Howdie allegators.. I&#39;m working on a simple openGL (allegroGL) demo and It&#39;s coming along quite nicely:<br />http://www.allegro.cc/files/attachment/594379<br />http://www.allegro.cc/files/attachment/594380<br />http://www.allegro.cc/files/attachment/594381<br />(sorry for the size)</p><p>But i have a problem(duh), These effects are somewhat boring and i want to create scenes with more fluffy side content, one thing i want too do is syncing some effect with the music I&#39;ll be playing, to do this i want to get the channel spectrum from fmod to use, I&#39;ve searched their forum for post on the matter but they all seem to old to work with my current version or something :S..</p><p>here&#39;s how i play a sound:
</p><div class="source-code snippet"><div class="inner"><pre>    FMOD_System_Create<span class="k2">(</span><span class="k3">&amp;</span>fmod_system<span class="k2">)</span><span class="k2">;</span>
    FMOD_System_Init<span class="k2">(</span>fmod_system, <span class="n">16</span>, <span class="n">0</span>, NULL<span class="k2">)</span><span class="k2">;</span>
    
    FMOD_System_CreateSound<span class="k2">(</span>fmod_system, <span class="s">"music.mp3"</span>, FMOD_2D, NULL, <span class="k3">&amp;</span>music<span class="k2">)</span><span class="k2">;</span>

    FMOD_System_PlaySound<span class="k2">(</span>core-&gt;fmod_system, <span class="k2">(</span>FMOD_CHANNELINDEX<span class="k2">)</span><span class="n">1</span>, core-&gt;music, FALSE, NULL<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

I hope someone has a spectrum analyzing code compatible with my code <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" />..</p><p>Thank you very much for your support <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Wed, 30 Jan 2008 01:32:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>FMOD Ex has a Channel::getSpectrum method that does exactly what you want. It basically gives you a parametrized spectrum of whatever sound is playing on the channel.</p><p>I don&#39;t really know about regular FMOD, but it should have something similar, and I&#39;m pretty sure it has some very general FFT stuff.</p><p>EDIT: A quick Google revealed regular FMOD has something called FMOD_System_GetSpectrum that is equivalent.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jakub Wasilewski)</author>
		<pubDate>Wed, 30 Jan 2008 02:50:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>EDIT: I think I&#39;ve gotten it to work.. NOT.</p><p>It doesn&#39;t crash now at least..<br />Here&#39;s a picture of the visualisation:<br /><span class="remote-thumbnail"><span class="json">{"name":"594386","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/c\/6c313d7c8d357f9f84b068d6810b143d.png","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/c\/6c313d7c8d357f9f84b068d6810b143d"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/6/c/6c313d7c8d357f9f84b068d6810b143d-240.jpg" alt="594386" width="240" height="180" /></span></p><p>This does not move at all :S. I&#39;ve read a lot about every value being 0 but i haven&#39;t found any information on this..</p><p>Hmm.. it seems to return 0.</p><p>I call FMOD_System_GetSpectrum every time i draw this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Wed, 30 Jan 2008 13:19:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, it wouldn&#39;t hurt if you showed us some code, you know.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jakub Wasilewski)</author>
		<pubDate>Wed, 30 Jan 2008 19:00:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Like what sort of code? All possible code related to the spectrum has already been posted :S.</p><p>woops.. when i said it returns 0 i meant FMOD_System_GetSpectrum retuned 0 <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Wed, 30 Jan 2008 19:37:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>FMOD_System_GetSpectrum return something between 0 and 1, so if you cast that into an int, there is a high chance you will always got a 0
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Thu, 31 Jan 2008 16:08:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="source-code"><span class="k1">if</span><span class="k2">(</span>FMOD_System_GetSpectrum<span class="k2">(</span>fmod_system, spectrum, <span class="n">512</span>, <span class="n">0</span>, FMOD_DSP_FFT_WINDOW_TRIANGLE<span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span>.<span class="n">0f</span><span class="k2">)</span>core-&gt;running <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span></span> is the condition valid? This closes my application as supposed to if GetSpectrum returns 0.0f.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Thu, 31 Jan 2008 23:13:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I do not see why you use GetSpectrum to see if the song is finished or not.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Fri, 01 Feb 2008 14:24:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Edit: I got it work now <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />, thank you.</p><p>I don&#39;t.. i just use the core-&gt;running = false; approach to confirm things fast and easy.. when &quot;running&quot; is true the application will go on, when &quot;running&quot; is false the application will close.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Sat, 02 Feb 2008 15:36:28 +0000</pubDate>
	</item>
</rss>
