<?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: restarting openAL after application interruption on the iPhone</title>
	<atom:link href="http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/</link>
	<description>Software should be simple.</description>
	<lastBuildDate>Sun, 18 Dec 2011 05:32:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Ben</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-378</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Sat, 17 Sep 2011 11:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-378</guid>
		<description>Hey Sinji,

lots has changed since I originally wrote this.  The way that interrupts are handled now in iOS is quite a bit different and really much easier.  I dont have the code in front of me, but if I remember correctly you dont have to do much at all during an interrupt.  If you are streaming and have a background thread running, you might want to do soething with that, but in terms of the OpenAL context I dont think you need to do much with it anymore.

I must apologize since I cant remember the specifics, check the docs. 

Cheers!
-B</description>
		<content:encoded><![CDATA[<p>Hey Sinji,</p>
<p>lots has changed since I originally wrote this.  The way that interrupts are handled now in iOS is quite a bit different and really much easier.  I dont have the code in front of me, but if I remember correctly you dont have to do much at all during an interrupt.  If you are streaming and have a background thread running, you might want to do soething with that, but in terms of the OpenAL context I dont think you need to do much with it anymore.</p>
<p>I must apologize since I cant remember the specifics, check the docs. </p>
<p>Cheers!<br />
-B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sinji</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-377</link>
		<dc:creator>sinji</dc:creator>
		<pubDate>Sat, 17 Sep 2011 11:05:44 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-377</guid>
		<description>Help?
everything works except that if the interruption comes while setting up audio session in the initial function. which cause the &#039;AudioSessionSetActive(true)&#039;
fails.
i try to use a while loop to make sure the audio session initialized correctly.
but it doesn&#039;t work.</description>
		<content:encoded><![CDATA[<p>Help?<br />
everything works except that if the interruption comes while setting up audio session in the initial function. which cause the &#8216;AudioSessionSetActive(true)&#8217;<br />
fails.<br />
i try to use a while loop to make sure the audio session initialized correctly.<br />
but it doesn&#8217;t work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeffmo77</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-369</link>
		<dc:creator>jeffmo77</dc:creator>
		<pubDate>Tue, 17 May 2011 00:06:11 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-369</guid>
		<description>Hmm, this looks awesome, and exactly what I need!  But after implementing, it seems that interruptionListenerCallback never gets called.  I&#039;m doing this in a cocos2D project within a CCLayer class.

Any ideas?

Jeffmo77</description>
		<content:encoded><![CDATA[<p>Hmm, this looks awesome, and exactly what I need!  But after implementing, it seems that interruptionListenerCallback never gets called.  I&#8217;m doing this in a cocos2D project within a CCLayer class.</p>
<p>Any ideas?</p>
<p>Jeffmo77</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oceansoul</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-359</link>
		<dc:creator>Oceansoul</dc:creator>
		<pubDate>Wed, 12 Jan 2011 07:10:40 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-359</guid>
		<description>Even if it means spamming your thread, I have to post one more thing.
I just tried out your code and well .. since you´re about to go home please take this as a big &#039;end-of-your-workday&#039;-HUG :). You just saved me such a huge amount of nerves and time and ... hell, years of my life which I would have spent brooding :).
Your piece of code works like charm.

Thanks a lot. I´ll recommend you ;).

Oceansoul</description>
		<content:encoded><![CDATA[<p>Even if it means spamming your thread, I have to post one more thing.<br />
I just tried out your code and well .. since you´re about to go home please take this as a big &#8216;end-of-your-workday&#8217;-HUG :). You just saved me such a huge amount of nerves and time and &#8230; hell, years of my life which I would have spent brooding :).<br />
Your piece of code works like charm.</p>
<p>Thanks a lot. I´ll recommend you ;).</p>
<p>Oceansoul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-358</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Wed, 12 Jan 2011 07:00:08 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-358</guid>
		<description>Hey Oceansoul,

No worries, glad you got it all figured out :-) 

My explanations can sometimes be a bit obtuse.  I don&#039;t like to just give big blocks of code right out, otherwise people generally just cut and paste it and don&#039;t try to understand what is actually going on. And sometimes, my explanations are just way _too_ obtuse, and nobody understands what the hell I am on about :-)  So your confusion is probably warranted :-)

Also, this is a good time of day since it is the end of the day and I am just looking for excuses to not be working anymore :-)

Cheers!
-B</description>
		<content:encoded><![CDATA[<p>Hey Oceansoul,</p>
<p>No worries, glad you got it all figured out :-) </p>
<p>My explanations can sometimes be a bit obtuse.  I don&#8217;t like to just give big blocks of code right out, otherwise people generally just cut and paste it and don&#8217;t try to understand what is actually going on. And sometimes, my explanations are just way _too_ obtuse, and nobody understands what the hell I am on about :-)  So your confusion is probably warranted :-)</p>
<p>Also, this is a good time of day since it is the end of the day and I am just looking for excuses to not be working anymore :-)</p>
<p>Cheers!<br />
-B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oceansoul</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-357</link>
		<dc:creator>Oceansoul</dc:creator>
		<pubDate>Wed, 12 Jan 2011 06:56:15 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-357</guid>
		<description>Whoa, that was a fast answer. Thanks for that. I just found it out, as well. And yes, it helped :).

Cheers</description>
		<content:encoded><![CDATA[<p>Whoa, that was a fast answer. Thanks for that. I just found it out, as well. And yes, it helped :).</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oceansoul</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-356</link>
		<dc:creator>Oceansoul</dc:creator>
		<pubDate>Wed, 12 Jan 2011 06:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-356</guid>
		<description>Nevermind. I think I got it :).</description>
		<content:encoded><![CDATA[<p>Nevermind. I think I got it :).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-355</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Wed, 12 Jan 2011 06:53:43 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-355</guid>
		<description>Hey Oceansoul,

When you call AudioSessionInitialize() the last parameter is: self.  This gets passed back into the callback function as the inUserData.  self being whatever class you are calling the initialize from within.

So when I put &#039;yourControlObject&#039; i mean to say that you need to cast that void* to the right class so you can then call methods on it effectively.  In my case my sound engine class is called BBSoundController, so I would cast that void* as a BBSoundController, then call _haltOpenALSession or whatever.  Your class will obviously be whatever you have created.

Similarly, all this code generally lives in that sound controller class.  So if you built a small sound engine using OpenAL, the class that you initialize the session with will be &quot;your sound control object&quot;.

Hope that helps!

CHeers!
-B</description>
		<content:encoded><![CDATA[<p>Hey Oceansoul,</p>
<p>When you call AudioSessionInitialize() the last parameter is: self.  This gets passed back into the callback function as the inUserData.  self being whatever class you are calling the initialize from within.</p>
<p>So when I put &#8216;yourControlObject&#8217; i mean to say that you need to cast that void* to the right class so you can then call methods on it effectively.  In my case my sound engine class is called BBSoundController, so I would cast that void* as a BBSoundController, then call _haltOpenALSession or whatever.  Your class will obviously be whatever you have created.</p>
<p>Similarly, all this code generally lives in that sound controller class.  So if you built a small sound engine using OpenAL, the class that you initialize the session with will be &#8220;your sound control object&#8221;.</p>
<p>Hope that helps!</p>
<p>CHeers!<br />
-B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oceansoul</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-354</link>
		<dc:creator>Oceansoul</dc:creator>
		<pubDate>Wed, 12 Jan 2011 06:46:06 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-354</guid>
		<description>Brief question.
This seems extremely helpful, but where do I have to put the several code pieces?
And what is YourSoundControlObject ??

Otherwise this article seems like a godsend. I built a small sound engine using OpenAL and the session problem was driving me crazy. 
So I´d be very glad for some more details on how to use your code snippets.

Oceansoul</description>
		<content:encoded><![CDATA[<p>Brief question.<br />
This seems extremely helpful, but where do I have to put the several code pieces?<br />
And what is YourSoundControlObject ??</p>
<p>Otherwise this article seems like a godsend. I built a small sound engine using OpenAL and the session problem was driving me crazy.<br />
So I´d be very glad for some more details on how to use your code snippets.</p>
<p>Oceansoul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ejoy2u</title>
		<link>http://benbritten.com/2009/02/02/restarting-openal-after-application-interruption-on-the-iphone/comment-page-1/#comment-342</link>
		<dc:creator>ejoy2u</dc:creator>
		<pubDate>Thu, 28 Oct 2010 03:36:48 +0000</pubDate>
		<guid isPermaLink="false">http://benbritten.com/?p=234#comment-342</guid>
		<description>I guess you got AUIOClient_StartIO failed.
I got the same issue yesterday, but if I debug and set breakpoint in resumeOpenALSession, I can hear sound everytime back to game.
So I put sleep after every line in resumeOpenALSession.
Yes, it works. you don&#039;t need to put the resume code to appwillresign, just sleep it a bit.
Actually, I fixed 5 of 10 bugs by sleep when I was using OpenAL on iPhone.</description>
		<content:encoded><![CDATA[<p>I guess you got AUIOClient_StartIO failed.<br />
I got the same issue yesterday, but if I debug and set breakpoint in resumeOpenALSession, I can hear sound everytime back to game.<br />
So I put sleep after every line in resumeOpenALSession.<br />
Yes, it works. you don&#8217;t need to put the resume code to appwillresign, just sleep it a bit.<br />
Actually, I fixed 5 of 10 bugs by sleep when I was using OpenAL on iPhone.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

