<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: New SoundManager Class</title>
	<atom:link href="http://www.71squared.com/2009/08/new-soundmanager-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.71squared.com/2009/08/new-soundmanager-class/</link>
	<description>iPhone Game Development - Web Development</description>
	<lastBuildDate>Sat, 04 Feb 2012 20:13:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Sound helpers at Under The Bridge</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-2/#comment-2043</link>
		<dc:creator>Sound helpers at Under The Bridge</dc:creator>
		<pubDate>Wed, 21 Oct 2009 06:04:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-2043</guid>
		<description>[...] New SoundManager Class is an OpenAL wrapper that apparently has 3D sound working well &#8212; which we actually haven&#8217;t encountered a need for yet, but as soon as we do run into something like that, this is definitely what we&#8217;ll start with! [...]</description>
		<content:encoded><![CDATA[<p>[...] New SoundManager Class is an OpenAL wrapper that apparently has 3D sound working well &#8212; which we actually haven&#8217;t encountered a need for yet, but as soon as we do run into something like that, this is definitely what we&#8217;ll start with! [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CC</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-2/#comment-1675</link>
		<dc:creator>CC</dc:creator>
		<pubDate>Tue, 01 Sep 2009 19:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-1675</guid>
		<description>Howdy.  I was just wondering if you were planning on updating the Sound Manager with stopSound and removeSound functionality.  I&#039;m still struggling off and on with audio issues, and I&#039;m sure others are, as well, given how much confusion there is out there about iPhone audio.

(Also, just a suggestion, it would be helpful to include in your downloadable package the support files the SoundManager references (OpenAL support and Singleton synthesis) for people who just want the Sound Manager stuff, especially since there are more than one similarly-named OpenAL support files floating around.)

Thanks again for sharing your work.  I wouldn&#039;t be as far along as I am without it.</description>
		<content:encoded><![CDATA[<p>Howdy.  I was just wondering if you were planning on updating the Sound Manager with stopSound and removeSound functionality.  I&#8217;m still struggling off and on with audio issues, and I&#8217;m sure others are, as well, given how much confusion there is out there about iPhone audio.</p>
<p>(Also, just a suggestion, it would be helpful to include in your downloadable package the support files the SoundManager references (OpenAL support and Singleton synthesis) for people who just want the Sound Manager stuff, especially since there are more than one similarly-named OpenAL support files floating around.)</p>
<p>Thanks again for sharing your work.  I wouldn&#8217;t be as far along as I am without it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Person</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-2/#comment-1643</link>
		<dc:creator>A Person</dc:creator>
		<pubDate>Sat, 29 Aug 2009 22:19:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-1643</guid>
		<description>Sorry about that i hit enter and it sent it.

@Anyone who knows trigrometery well

With my Render Manager complete i have been working on a custom rotate function with some google research i found this
&lt;pre&gt;
NewX = x*cos(angle) - y*sin(angle)
NewY = x*sin(angle) + y*cos(angle)

x = NewX
y = NewY
&lt;/pre&gt;
i have tried this with my own version however it doesent seem to work

basically when it draws a triangle appears at (0, 240) and some coordinates are negative 

here is the code
&lt;pre&gt;
float verts[8] = {vertices[0].tl_x, vertices[0].tl_y, vertices[0].tr_x, vertices[0].tr_y, vertices[0].bl_x, vertices[0].bl_y, vertices[0].br_x, vertices[0].br_y};
float destination[8];
destination[0] = verts[0]*cos(45) - verts[1]*sin(45);
destination[1] = verts[0]*sin(45) + verts[1]*cos(45);
destination[2] = verts[2]*cos(45) - verts[3]*sin(45);
destination[3] = verts[2]*sin(45) + verts[3]*cos(45);
destination[4] = verts[4];
destination[5] = verts[5];
destination[6] = verts[6]*cos(45) - verts[7]*sin(45);
destination[7] = verts[6]*sin(45) + verts[7]*cos(45);
&lt;/pre&gt;
I know it is inefficent right now but i&#039;ll fix that later this is just a test

I also know mike has a custom opengl stack thing but i don&#039;t want to figure out how to change it to except Quad2*</description>
		<content:encoded><![CDATA[<p>Sorry about that i hit enter and it sent it.</p>
<p>@Anyone who knows trigrometery well</p>
<p>With my Render Manager complete i have been working on a custom rotate function with some google research i found this</p>
<pre>
NewX = x*cos(angle) - y*sin(angle)
NewY = x*sin(angle) + y*cos(angle)

x = NewX
y = NewY
</pre>
<p>i have tried this with my own version however it doesent seem to work</p>
<p>basically when it draws a triangle appears at (0, 240) and some coordinates are negative </p>
<p>here is the code</p>
<pre>
float verts[8] = {vertices[0].tl_x, vertices[0].tl_y, vertices[0].tr_x, vertices[0].tr_y, vertices[0].bl_x, vertices[0].bl_y, vertices[0].br_x, vertices[0].br_y};
float destination[8];
destination[0] = verts[0]*cos(45) - verts[1]*sin(45);
destination[1] = verts[0]*sin(45) + verts[1]*cos(45);
destination[2] = verts[2]*cos(45) - verts[3]*sin(45);
destination[3] = verts[2]*sin(45) + verts[3]*cos(45);
destination[4] = verts[4];
destination[5] = verts[5];
destination[6] = verts[6]*cos(45) - verts[7]*sin(45);
destination[7] = verts[6]*sin(45) + verts[7]*cos(45);
</pre>
<p>I know it is inefficent right now but i&#8217;ll fix that later this is just a test</p>
<p>I also know mike has a custom opengl stack thing but i don&#8217;t want to figure out how to change it to except Quad2*</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Early</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-2/#comment-1619</link>
		<dc:creator>Early</dc:creator>
		<pubDate>Thu, 27 Aug 2009 18:08:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-1619</guid>
		<description>Hi Mike,  I don&#039;t know that I am understanding the sourceID completely.

everything works fine when I use -1 but if I try assigning a source id I don&#039;t get any sound.
&lt;pre&gt;
if(_player.moving == YES){
	[_sharedSoundManager playSoundWithKey:@&quot;Walking&quot; gain:2.0f pitch:1.0f location:Vector2fMake(_player.tileX * 50, _player.tileY * 50) shouldLoop:NO sourceID:5];
}
&lt;/pre&gt;
is there something else I have to do to assign a sourceID?</description>
		<content:encoded><![CDATA[<p>Hi Mike,  I don&#8217;t know that I am understanding the sourceID completely.</p>
<p>everything works fine when I use -1 but if I try assigning a source id I don&#8217;t get any sound.</p>
<pre>
if(_player.moving == YES){
	[_sharedSoundManager playSoundWithKey:@"Walking" gain:2.0f pitch:1.0f location:Vector2fMake(_player.tileX * 50, _player.tileY * 50) shouldLoop:NO sourceID:5];
}
</pre>
<p>is there something else I have to do to assign a sourceID?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-2/#comment-1572</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Sat, 22 Aug 2009 08:42:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-1572</guid>
		<description>@CC, I ran my game through instruments last night.  I saw a couple of leaks right at the start which looked to be down inside the frameworks themselves, but after than there were no leaks reported and object allocation was stable.

If you want to take a screen shot of instruments showing the leaks and email them to me or if there is code you can share I&#039;ll take a look.

Mike</description>
		<content:encoded><![CDATA[<p>@CC, I ran my game through instruments last night.  I saw a couple of leaks right at the start which looked to be down inside the frameworks themselves, but after than there were no leaks reported and object allocation was stable.</p>
<p>If you want to take a screen shot of instruments showing the leaks and email them to me or if there is code you can share I&#8217;ll take a look.</p>
<p>Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-2/#comment-1569</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Fri, 21 Aug 2009 16:06:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-1569</guid>
		<description>@CC, ouch.  Its well known that there are leaks deep down inside apples own frameworks that we can&#039;t do much about and it could be we have found some.  I will though check this out tonight and see if anything is related to how I&#039;m doing things.

Thanks for the info.

Mike</description>
		<content:encoded><![CDATA[<p>@CC, ouch.  Its well known that there are leaks deep down inside apples own frameworks that we can&#8217;t do much about and it could be we have found some.  I will though check this out tonight and see if anything is related to how I&#8217;m doing things.</p>
<p>Thanks for the info.</p>
<p>Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CC</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-2/#comment-1568</link>
		<dc:creator>CC</dc:creator>
		<pubDate>Fri, 21 Aug 2009 16:03:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-1568</guid>
		<description>In removeSoundWithKey:, you have:

glDeleteBuffers(1, &amp;bufferID);

I think that should be:

alDeleteBuffers(1, &amp;bufferID);

Regarding the memory leak, I just created a clean project and added the SoundManager class to it.  By merely calling:

SoundManager *sm = [SoundManager sharedSoundManager];

...without loading or playing any sounds, I get two memory leaks. 

Both are apparently leaked when we call alcMakeContextCurrent in initOpenAL.  I don&#039;t see anything wrong with that, but then, I am completely new to OpenAL.

If I then try to load a sound, I end up with 10 *more* leaks.</description>
		<content:encoded><![CDATA[<p>In removeSoundWithKey:, you have:</p>
<p>glDeleteBuffers(1, &amp;bufferID);</p>
<p>I think that should be:</p>
<p>alDeleteBuffers(1, &amp;bufferID);</p>
<p>Regarding the memory leak, I just created a clean project and added the SoundManager class to it.  By merely calling:</p>
<p>SoundManager *sm = [SoundManager sharedSoundManager];</p>
<p>&#8230;without loading or playing any sounds, I get two memory leaks. </p>
<p>Both are apparently leaked when we call alcMakeContextCurrent in initOpenAL.  I don&#8217;t see anything wrong with that, but then, I am completely new to OpenAL.</p>
<p>If I then try to load a sound, I end up with 10 *more* leaks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-2/#comment-1567</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Fri, 21 Aug 2009 14:42:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-1567</guid>
		<description>Hi CC, I cant say I&#039;ve seen any problems with memory leaks using the SoundManager class.  That said, I&#039;ve not been looking at leaks lately as I&#039;ve been working performance issues with the iPhone 3G.  iPod 2nd Gen, iPhone 3Gs fantastic, 60fps, not a blip.  iPhone 3G with the same code and its been running like a dog :o(

Anyway, enough about that, I&#039;ll take a look in instruments when I get home later to see if I am getting any leaks as well.

What size/length of sounds are you using in OpenAL and for music.  I&#039;m only loading up a few small wav files at the moment which could be why I am not seeing any leaks.  I&#039;m also not releasing any sounds at the moment either.

Let me know what you are doing and I&#039;ll check it out my end.

Mike</description>
		<content:encoded><![CDATA[<p>Hi CC, I cant say I&#8217;ve seen any problems with memory leaks using the SoundManager class.  That said, I&#8217;ve not been looking at leaks lately as I&#8217;ve been working performance issues with the iPhone 3G.  iPod 2nd Gen, iPhone 3Gs fantastic, 60fps, not a blip.  iPhone 3G with the same code and its been running like a dog :o(</p>
<p>Anyway, enough about that, I&#8217;ll take a look in instruments when I get home later to see if I am getting any leaks as well.</p>
<p>What size/length of sounds are you using in OpenAL and for music.  I&#8217;m only loading up a few small wav files at the moment which could be why I am not seeing any leaks.  I&#8217;m also not releasing any sounds at the moment either.</p>
<p>Let me know what you are doing and I&#8217;ll check it out my end.</p>
<p>Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CC</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-1/#comment-1566</link>
		<dc:creator>CC</dc:creator>
		<pubDate>Fri, 21 Aug 2009 14:30:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-1566</guid>
		<description>@Mike, glad to help.

What about the memory leak I mentioned?  Do you see it, too?

You know, I&#039;ve been learning Objective-C, Cocoa, and the iPhone SDK for a good couple of months now, and everything has come together swimmingly for me, with the sole exception of audio (so far, knock on wood).  It seems like no matter what I try, I run into problems, either unacceptable latency or memory leaks or restrictions on length of audio.

So, I appreciate you putting up your work and sharing it.  I think if we can squash this memory leak, I&#039;ll have a final, workable solution.  Thanks.</description>
		<content:encoded><![CDATA[<p>@Mike, glad to help.</p>
<p>What about the memory leak I mentioned?  Do you see it, too?</p>
<p>You know, I&#8217;ve been learning Objective-C, Cocoa, and the iPhone SDK for a good couple of months now, and everything has come together swimmingly for me, with the sole exception of audio (so far, knock on wood).  It seems like no matter what I try, I run into problems, either unacceptable latency or memory leaks or restrictions on length of audio.</p>
<p>So, I appreciate you putting up your work and sharing it.  I think if we can squash this memory leak, I&#8217;ll have a final, workable solution.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.71squared.com/2009/08/new-soundmanager-class/comment-page-1/#comment-1563</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 21 Aug 2009 08:48:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.71squared.co.uk/?p=772#comment-1563</guid>
		<description>@Mike

Yes, the difference is for compressed sound, so it only applies to the music, not OpenAL. However changing to the hardware decoding for music made quite a difference to performance for me when playing music.

The approach I&#039;ve adopted is to check at startup whether or not the ipod is currently playing audio - if it isn&#039;t, I use AmbientSound and set a music mute flag, so that the user&#039;s ipod music continues to play. If the user then unmutes the music in the game menu, the category is changed to SoloAmbientSound  and the ipod music stops.
If not, I use SoloAmbientSound and my game&#039;s music plays from the start.</description>
		<content:encoded><![CDATA[<p>@Mike</p>
<p>Yes, the difference is for compressed sound, so it only applies to the music, not OpenAL. However changing to the hardware decoding for music made quite a difference to performance for me when playing music.</p>
<p>The approach I&#8217;ve adopted is to check at startup whether or not the ipod is currently playing audio &#8211; if it isn&#8217;t, I use AmbientSound and set a music mute flag, so that the user&#8217;s ipod music continues to play. If the user then unmutes the music in the game menu, the category is changed to SoloAmbientSound  and the ipod music stops.<br />
If not, I use SoloAmbientSound and my game&#8217;s music plays from the start.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

