<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<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">
	<channel>
		<title>cocos2d for iPhone &#187; Tag: CocosDenshion - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/cocosdenshion</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 04:27:19 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/tags/cocosdenshion/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>Arbel on "Ways to reduce sound lag"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28230#post-138891</link>
			<pubDate>Tue, 10 Jan 2012 11:50:27 +0000</pubDate>
			<dc:creator>Arbel</dc:creator>
			<guid isPermaLink="false">138891@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am making a music game and when the user presses a note it will produce a sound. The sound naturally needs to play immediately when the user presses, so they can tell whether they are in time with the music. However, it feels as if the sound is lagging, especially when note presses become quicker.</p>
<p>My background .m4a music file is played with AVAudioPlayer. I chose to use this as I have access to the currentTime property. I may be wrong, but I dont think I can access this with CocosDenshion.</p>
<p>I made a .wav file which is extremely short (a few hundred milliseconds). I preload my sound effect on init:</p>
<pre><code>[[SimpleAudioEngine sharedEngine] preloadEffect:@&#34;Assist.wav&#34;];</code></pre>
<p>Then to play the sound effect, in CCTouchesBegan I call:<br />
<pre><code>[[SimpleAudioEngine sharedEngine] playEffect:@&#34;Assist.wav&#34;];</code></pre>
<p>After that it calls my code to determine the users timing and awards points. Any idea why it might be lagging, or a better way to play sound effects in time with music?
</p></description>
		</item>
		<item>
			<title>SpudGT on "Crash on become active - iOS5 sound related?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21909#post-121737</link>
			<pubDate>Mon, 17 Oct 2011 21:15:02 +0000</pubDate>
			<dc:creator>SpudGT</dc:creator>
			<guid isPermaLink="false">121737@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>In the middle of making my iPad application universal, ran into a crash on my iPhone 4 running iOS 5 (cocos2d 1.0.1). Not seeing the same problem in my iPad2 running iOS 5.</p>
<p>General sequence of events:<br />
- Start application, loads scene with background music playing<br />
- put app to background, wait over a minute<br />
- resume the app, app seems hung, then crashes (is terminated) about 10 seconds later</p>
<p>It's not 100% repeatable, but happens a lot.</p>
<p>I set the following:<br />
<code>[[CDAudioManager sharedManager] setResignBehavior:kAMRBStopPlay autoHandle:YES];</code></p>
<p>On resign active I see (note I added a bit of debug output):<br />
<pre><code>Oct 17 14:29:41 unknown MyApp[6397] &#60;Warning&#62;: cocos2d: Frame interval: 15
Oct 17 14:29:41 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - resign active called
Oct 17 14:29:41 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - Attempt to set Audio session category AVAudioSessionCategoryAmbient
Oct 17 14:29:41 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - Audio session set category AVAudioSessionCategoryAmbient succeeded
Oct 17 14:29:41 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - audio source was playing &#60;CDLongAudioSource: 0x3411b0&#62;
Oct 17 14:29:41 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - handled resign active</code></pre>
<p>Then on become active:<br />
<pre><code>Oct 17 14:32:38 unknown MyApp[6397] &#60;Warning&#62;: cocos2d: Frame interval: 15
Oct 17 14:32:38 unknown MyApp[6397] &#60;Warning&#62;: cocos2d: Frame interval: 1
Oct 17 14:32:38 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - become active called
Oct 17 14:32:38 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - Other audio is not playing audio will be exclusive
Oct 17 14:32:38 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - Attempt to set Audio session category AVAudioSessionCategorySoloAmbient
Oct 17 14:32:47 unknown MyApp[6397] &#60;Error&#62;: 14:32:47.932 &#60;0x3f807ce8&#62; AudioSessionSetProperty posting message to kill mediaserverd (6317)
Oct 17 14:32:47 unknown mediaserverd[6317] &#60;Error&#62;: &#60;&#60;&#60;&#60; FIGSERVER &#62;&#62;&#62;&#62; FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received to terminate [6317] with reason &#039;AudioSessionSetProperty&#039;
Oct 17 14:32:48 unknown ReportCrash[6400] &#60;Error&#62;: Saved crashreport to /Library/Logs/CrashReporter/mediaserverd-2011-10-17-143248.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Oct 17 14:32:48 unknown mediaserverd[6317] &#60;Error&#62;: &#60;&#60;&#60;&#60; FIGSERVER &#62;&#62;&#62;&#62; FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received; stackshot generated
Oct 17 14:32:48 unknown mediaserverd[6317] &#60;Error&#62;: &#60;&#60;&#60;&#60; FIGSERVER &#62;&#62;&#62;&#62; FigPlayerRemoteServer_KillAndForceCrashReport: TERMINATING our process [6317]
Oct 17 14:32:48 unknown com.apple.launchd[1] &#60;Notice&#62;: (com.apple.mediaserverd) Exited: Killed: 9
Oct 17 14:32:48 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - Audio session set category AVAudioSessionCategorySoloAmbient succeeded
Oct 17 14:32:48 unknown MyApp[6397] &#60;Warning&#62;: Denshion::CDAudioManager - audio source was system paused &#60;CDLongAudioSource: 0x3411b0&#62;
Oct 17 14:32:48 unknown kernel[0] &#60;Debug&#62;: launchd[6401] Builtin profile: mediaserverd (sandbox)
Oct 17 14:32:49 unknown mediaserverd[6401] &#60;Error&#62;: 14:32:49.368387 com.apple.AVConference: /SourceCache/GameKitServices/GameKitServices-344.3/AVConference.subproj/Sources/AVConferenceServer.m:1867: AVConferenceServerStart
Oct 17 14:32:49 unknown SpringBoard[15] &#60;Warning&#62;: com.domain.MyApp failed to resume in time
Oct 17 14:32:49 unknown SpringBoard[15] &#60;Warning&#62;: Forcing crash report of MyApp[6397]...
Oct 17 14:32:49 unknown SpringBoard[15] &#60;Warning&#62;: Finished crash reporting.
Oct 17 14:32:49 unknown com.apple.launchd[1] &#60;Notice&#62;: (UIKitApplication:com.domain.MyApp[0x678d]) Exited: Killed: 9
Oct 17 14:32:49 unknown SpringBoard[15] &#60;Warning&#62;: Application &#039;My App&#039; exited abnormally with signal 9: Killed: 9</code></pre>
<p>Looks like I am getting stuck in audioSessionSetCategory ...</p>
<p>Anyone have tips on where to start looking (or what additional information would be useful)?
</p></description>
		</item>
		<item>
			<title>badgerr on "CDSoundSource mute has no effect"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28832#post-142062</link>
			<pubDate>Tue, 31 Jan 2012 21:23:00 +0000</pubDate>
			<dc:creator>badgerr</dc:creator>
			<guid isPermaLink="false">142062@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am trying to directly control the gain of CDSoundSource objects, as I want to mute some sound effects but not others.</p>
<p><code>alListenerf(AL_GAIN, g)</code> correctly controls volume of all effects, however, <code>alSourcef(id, AL_GAIN, g)</code> has no effect.</p>
<p>This can be seen in a "from scratch" project I knocked up with the XCode4 template and some minor code modifications to SimpleAudioEngine:</p>
<p>In SimpleAudioEngine.h:<br />
<code>-(void) muteEffect:(ALuint) soundId;</code></p>
<p>In SimpleAudioEngine.m:<br />
<pre><code>-(void) muteEffect:(ALuint) soundId {
  CDSoundSource *result = [soundEngine soundSourceForSound:soundId sourceGroupId:0];
  if(result) {
    result.mute = YES;
  }
}</code></pre>
<p>Now a simple example of playing an effect then muting it still results in it being audible:</p>
<pre><code>int soundId = [[SimpleAudioEngine sharedEngine] playEffect:@&#34;test.caf&#34;];
[[SimpleAudioEngine sharedEngine] muteEffect:soundId];</code></pre>
<p>As I step through the code in the debugger I can see all of the correct code paths being followed, and the alSourcef functions being called, with no error codes in lastError.</p>
<p>The problem occurs in both the iOS5 simulator and an iPhone 4 running 4.3.2.</p>
<p>Why doesn't this work?
</p></description>
		</item>
		<item>
			<title>akki2010 on "SimpleAudioEngine and Video Ads"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22239#post-123493</link>
			<pubDate>Fri, 28 Oct 2011 22:04:58 +0000</pubDate>
			<dc:creator>akki2010</dc:creator>
			<guid isPermaLink="false">123493@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I am trying to integrate video ads with in my game and once the video ad is dismissed I can hear the background track to resume playing but there is no sound effects played. To play the sund effects I am using simple audio engine. The debug log shows me that the audio is being loaded in the but I can't hear the effect.</p>
<p>Denshion::CDSoundEngine - Loading openAL buffer 5 Whoosh.m4a<br />
Denshion::CDSoundEngine - Loading buffer 5<br />
Denshion::CDSoundEngine -  =============== Buffer Loaded =============== </p>
<p>Please help to figure out where am I going wrong.</p>
<p>Regards,</p>
<p>Ankur
</p></description>
		</item>
		<item>
			<title>lummis on "Could someone please help with this cocosDenshion crash?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28572#post-140690</link>
			<pubDate>Sun, 22 Jan 2012 19:33:14 +0000</pubDate>
			<dc:creator>lummis</dc:creator>
			<guid isPermaLink="false">140690@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm using cocos2d 1.0.1 and Xcode 4.2.1 on Lion. I don't see any version number in the cocosDension files. They say copyright 2010. This same crash occurs on both the simulator and the device. The rest of this description refers to running on the simulator. </p>
<p>I tried running two of the Denshion tests (demos) and they work as expected. </p>
<p>Prior to this I ran the project many times (in debug mode) without a sound problem (probably hundreds of times). So far as I know I didn't change anything related to sound before the crash started happening -- I was repeatedly changing the text of several labels to make them look right and none of them are associated with any sounds. Thinking that maybe I'm running out of memory I deleted all of the labels I was editing (a few hundred bytes), which definitely makes them smaller than they were before the crash, but I still get the crash.</p>
<p>Running of the simulator I get the following message when the crash happens. (It is possible that I always had this message even when it didn't crash):</p>
<p>2012-01-22 13:51:40.932 Darken[1772:12503] Denshion::CDAudioManager - Audio session set category AVAudioSessionCategorySoloAmbient failed with error Error Domain=NSOSStatusErrorDomain Code=-50 "The operation couldn’t be completed. (OSStatus error -50.)"<br />
AudioStreamBasicDescription:  2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved</p>
<p>"macerror -50" gives this description for error -50: "Mac OS error -50 (paramErr): error in user parameter list" </p>
<p>Backtrace shows that the last statement of mine before the crash was:<br />
<code>sae = [SimpleAudioEngine sharedEngine];</code></p>
<p>and that is the first time SimpleAudioEngine is called in my project.</p>
<p>The last statement in Denshion before the crash is CocosDension.m line 209:<br />
<code>alcMakeContextCurrent(context);</code></p>
<p>and the value of context is 0x19. I couldn't figure out if 0x19 is a valid value. (If it isn't that would agree with the OS error -50 description.)</p>
<p>In accordance with a comment in CDConfig.h I enabled:<br />
<code>#<a href='http://www.cocos2d-iphone.org/forum/tags/define'>define</a> CD_DEBUG 1</code> </p>
<p>but that didn't result in any additional messages. </p>
<p>Now I'm out of debugging ideas and I'm stuck. I can't work on my project because it won't run. I would be grateful if someone could tell me what's wrong or at least suggest a way to debug this crash.
</p></description>
		</item>
		<item>
			<title>helloniklas on "CocosDenshion device audio adjustment not working"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22380#post-124220</link>
			<pubDate>Wed, 02 Nov 2011 17:18:33 +0000</pubDate>
			<dc:creator>helloniklas</dc:creator>
			<guid isPermaLink="false">124220@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello, I'\ playing back sounds with the CocosDenshion API, it's all working fine. But, on the iPad when adjusting the volume with the button on the side of the iPad, it takes &#160;a very long time before the audio is adjusted. I.e. if I try and turn the volume down, it still plays on &#160;a high volume for several seconds, before adjusting down.<div><br /></div><div>Any one experienced this?</div><div><br /></div>
</p></description>
		</item>
		<item>
			<title>hareball on "Buffer limit"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24607#post-129956</link>
			<pubDate>Mon, 28 Nov 2011 23:52:15 +0000</pubDate>
			<dc:creator>hareball</dc:creator>
			<guid isPermaLink="false">129956@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi everyone,<br />
I've been using cocosdenshion for our new app, and it's a great free bit of software... But recently I've had some issues with soundSourceForFile returning nil. Now I've dug a little deeper and found that CD_NO_SOURCE is true before kCDNoBuffer is set true. This happens when the buffer hits 32.  I have CD_BUFFERS_START set to 64, and CD_BUFFERS_INCREMENT set to 16 in CDConfig.h. I've been careful to unloadEffect before I release, but since I have lots of small sounds, I'm hitting the 32 buffer spaces just through normal usage. I've also tried Cd_DEBUG 2, but get no error, even though it still returns nil. </p>
<p>Hopefully someone can help... I keep thinking I've some something bad, but I don't know what!</p>
<p>Oh I'm also using the latest version.
</p></description>
		</item>
		<item>
			<title>dimitriosb on "Play streaming sound with CocosDenshion"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22370#post-124176</link>
			<pubDate>Wed, 02 Nov 2011 11:24:03 +0000</pubDate>
			<dc:creator>dimitriosb</dc:creator>
			<guid isPermaLink="false">124176@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,<div><br /></div><div>I want to play a music file without loading all of it in memory, as it currently takes up 30 MB when loaded. I want to use streaming, so that the buffer does not load the whole file. Is that possible with CocosDenshion?</div><div><br /></div><div>I only found this post&#160;<a href="http://www.cocos2d-iphone.org/forum/topic/13638">http://www.cocos2d-iphone.org/forum/topic/13638</a>&#160;but I understand that the reply refers only to dynamically generated audio.</div><div><br /></div><div>Thank you,</div><div>Dimitrios</div>
</p></description>
		</item>
		<item>
			<title>Steve Oldmeadow on "CocosDenshion update 2.0"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/553#post-3314</link>
			<pubDate>Thu, 09 Jul 2009 09:39:04 +0000</pubDate>
			<dc:creator>Steve Oldmeadow</dc:creator>
			<guid isPermaLink="false">3314@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I've checked in some changes that came about from issues AkumaStreak was having integrating CocosDenshion with his project.<br />
Unfortunately it has meant some small API changes so I've changed the version number to 2.0 to reflect this version is not backwards compatible with older versions of CocosDenshion.</p>
<p>The update adds two features:<br />
* Load sounds from a path rather than a filename so you have much more flexibility now in where the sounds are located;<br />
* Removal of C++ dependencies which greatly simplifies the inclusion of CocosDenshion in a static library.</p>
<p>The two issues you will have when upgrading are:<br />
* All methods that previously took fileName now take filePath so just go and change fileName to filePath;<br />
* All .mm files are now .m files - you will need to remove the .mm files and add the .m versions to your project.</p>
<p>I apologize for any problems this causes but I think it is better for CocosDenshion and cocos2d overall.
</p></description>
		</item>
		<item>
			<title>bubba on "CocosDenshion causing build errors"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22138#post-123013</link>
			<pubDate>Tue, 25 Oct 2011 23:02:48 +0000</pubDate>
			<dc:creator>bubba</dc:creator>
			<guid isPermaLink="false">123013@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>FYI, I've encountered this situation:</p>
<p>1. Create a new project using the cocos2d iOS template<br />
2. Set deployment target to 2.2.1<br />
3. Build the game for the device (I'm using an iPhone 4s with iOS 5, havent tested other devices)<br />
4. Project won't compile due to tons of errors in CDAudioManager.m, CDAudioManager.h, CocosDenshion.h</p>
<p>It builds fine if I change the deployment target to 3.0<br />
Is this expected behavior?
</p></description>
		</item>
		<item>
			<title>applehund on "How many sounds can we have loaded?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22014#post-122358</link>
			<pubDate>Fri, 21 Oct 2011 06:50:15 +0000</pubDate>
			<dc:creator>applehund</dc:creator>
			<guid isPermaLink="false">122358@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I'm loading a ton of .wav files with [SimpleAudioEngine preloadEffect]. Am curious though when I will start to see crashes related to having too many sounds loaded in memory? Is there a limit like with textures?</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>lummis on "What does this CocosDenshion error message mean?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21959#post-122052</link>
			<pubDate>Wed, 19 Oct 2011 14:56:25 +0000</pubDate>
			<dc:creator>lummis</dc:creator>
			<guid isPermaLink="false">122052@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>The following statement:<br />
<pre><code>sae = [SimpleAudioEngine sharedEngine];</code></pre>
<p>results in the following message on the console log:</p>
<pre><code>Denshion::CDAudioManager - Audio session set category AVAudioSessionCategorySoloAmbient failed with error Error Domain=NSOSStatusErrorDomain Code=-50 &#34;The operation couldn’t be completed. (OSStatus error -50.)&#34;
AudioStreamBasicDescription:  2 ch,  44100 Hz, &#039;lpcm&#039; (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved</code></pre>
<p>This was determined by putting a break point on the statement then single stepping past it.  This is the first time SimpleAudioEngine is referenced in the app. I am using effects sounds only (no background music) and all the effects seem to be working but this error message must be telling me that something isn't set up the way it should be. What is wrong?
</p></description>
		</item>
		<item>
			<title>yun on "Use MPMusicPlayerController to play background music with SimpleAudioEngine"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21502#post-119478</link>
			<pubDate>Tue, 04 Oct 2011 07:34:18 +0000</pubDate>
			<dc:creator>yun</dc:creator>
			<guid isPermaLink="false">119478@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I tried to use MPMusicPlayerController to play ipod music as my background music and use SimpleAudioEngine to play the sound effects.</p>
<p>here is my setup :<br />
<pre><code>[self setMusicPlayer: [MPMusicPlayerController applicationMusicPlayer]];

        [musicPlayer setShuffleMode: MPMusicShuffleModeOff];
        [musicPlayer setRepeatMode: MPMusicRepeatModeAll];

        [[CDAudioManager sharedManager] setMode:kAMM_FxOnly];

        if (ENABLE_IPOD_LIB)
        {
            musicPlayer.volume = 0.5;
        }</code></pre>
<p>But the musicPlayer.volume will also affect the sound effects.</p>
<p>Are there any method to setup the sound volumes of  MPMusicPlayerController  and SimpleAudioEngine independently ? </p>
<p>Thanks.
</p></description>
		</item>
		<item>
			<title>tjgillis on "SimpleAudioEngine effects don&#039;t play after call"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20399#post-113431</link>
			<pubDate>Tue, 30 Aug 2011 13:27:23 +0000</pubDate>
			<dc:creator>tjgillis</dc:creator>
			<guid isPermaLink="false">113431@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey all,<br />
I've using SimpleAudioEngine to play some sound effects but when I receive a call that effects won't play anymore when I return to the game, but the background music plays fine. </p>
<p>All I'm doing is preloading and playing. Nothing too fancy and I haven't changed the default handlers for the pausing and resuming of the app. </p>
<p>Has anyone encountered this before? </p>
<p>Thanks,<br />
TJ
</p></description>
		</item>
		<item>
			<title>nospam4me on "SimpleAudioEngine playEffect: with a callback"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/13474#post-75662</link>
			<pubDate>Fri, 11 Feb 2011 12:46:41 +0000</pubDate>
			<dc:creator>nospam4me</dc:creator>
			<guid isPermaLink="false">75662@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,<br />
I'm playing sounds using SimpleAudioEngine playEffect:.<br />
Everythings works fine, except that's I need to know when the sound is finished.<br />
Is there a simple way to be notified when the playing is finished ?<br />
Something like :<br />
SimpleAudioEngine playEffect:(NSString*)file withTarget:(id)target andCallback:(SEL)callback<br />
Thanks.
</p></description>
		</item>
		<item>
			<title>prashn64 on "Having a problem with the schedule method."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19965#post-111437</link>
			<pubDate>Fri, 19 Aug 2011 13:48:23 +0000</pubDate>
			<dc:creator>prashn64</dc:creator>
			<guid isPermaLink="false">111437@http://www.cocos2d-iphone.org/forum/</guid>
			<description><pre><code>//
//  AudioListManager.m
//  WhatsUp
//
//  Created by john doe on 8/18/11.
//  Copyright 2011 Dreamkind. All rights reserved.
//

#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;AudioListManager.h&#34;

@implementation AudioListManager
@synthesize currentIndex = currentIndex_;
@synthesize soundList = soundList_;
static AudioListManager* sharedSingleton;

+ (AudioListManager*) getInstance {
    static BOOL initialized = NO;
    if(!initialized)
    {
        initialized = YES;
        sharedSingleton = [[AudioListManager alloc] init];
        sharedSingleton.currentIndex = 0;
        sharedSingleton.soundList = [[NSMutableArray alloc] init];
    }
    return sharedSingleton;
}

- (id)init
{
    self = [super init];
    if (self) {

    }

    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void) startPlayBack {
    timeTracker = 0;
    currentIndex_ = 0;
    [[SimpleAudioEngine sharedEngine] playEffect:[soundList_ objectAtIndex:currentIndex_]];
    [self schedule:@selector(checkAudioFileEnded:)];
}

- (void) checkAudioFileEnded:(ccTime)dt {
    NSLog(@&#34;Ticking&#34;);
    timeTracker += dt;
    if(currentIndex_ &#60; [soundList_ count]) {
        if(timeTracker &#62; [[[SimpleAudioEngine sharedEngine] soundSourceForFile:[soundList_ objectAtIndex:currentIndex_]] durationInSeconds]) {
            currentIndex_ ++;
            [[SimpleAudioEngine sharedEngine] playEffect:[soundList_ objectAtIndex:currentIndex_]];
            timeTracker = 0;
        }
    }
    else
    {
        [self unschedule:@selector(checkAudioFileEnded:)];
    }
}

@end</code></pre>
<p>This is the entire class.  The problem line is [self schedule:@selector(checkAudioFileEnded:)];</p>
<p>The program gets to startPlayBack method, that I know, because it plays the audio file, and I've checked it using breakpoints, but the NSLog in checkAudioFileEnded never fires, and a breakpoint never gets there.</p>
<p>It seems like pretty simple schedule code, and I've used the same syntax in other parts of the project but can't get it to work here.
</p></description>
		</item>
		<item>
			<title>OhCaN on "Saving recorded mic input to a permanent file."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19827#post-110920</link>
			<pubDate>Tue, 16 Aug 2011 16:49:23 +0000</pubDate>
			<dc:creator>OhCaN</dc:creator>
			<guid isPermaLink="false">110920@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey,</p>
<p>I've got a project where Im letting the user record himself and then play it back, some sort of audio notes. The recording and playback works great, but the files dissapear when I re enter the application. </p>
<p>I assume they dissapear, because when I try to play them back I get the following error:<br />
<code>The operation couldn’t be completed. (OSStatus error -50.)</code></p>
<p>and the path is the exact same as it was before:<br />
<code>/var/mobile/Applications/CD2A4CC8-6ADF-4350-8192-522E685A459F/Documents/rec__1.caf</code></p>
<p>The code I use to get the file path where I should save it follows:<br />
<pre><code>- (NSString*) getMP3FileName {

    NSArray *dirPaths;
    NSString *docsDir;

    dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    docsDir = [dirPaths objectAtIndex:0];
    CCLOG(@&#34;Filename: %@&#34;, [docsDir stringByAppendingPathComponent:[NSString stringWithFormat:@&#34;rec__%d.caf&#34;,_currPage]]);
    return [docsDir stringByAppendingPathComponent:[NSString stringWithFormat:@&#34;rec__%d.caf&#34;,_currPage]];
}</code></pre>
<p>And this is how i setup the recorder:<br />
<pre><code>NSURL *soundFileURL = [NSURL fileURLWithPath:[self getMP3FileName]];

        NSDictionary *recordSettings = [NSDictionary
                                        dictionaryWithObjectsAndKeys:
                                        [NSNumber numberWithInt:AVAudioQualityMin],
                                        AVEncoderAudioQualityKey,
                                        [NSNumber numberWithInt:16],
                                        AVEncoderBitRateKey,
                                        [NSNumber numberWithInt: 2],
                                        AVNumberOfChannelsKey,
                                        [NSNumber numberWithFloat:44100.0],
                                        AVSampleRateKey,
                                        nil];

        NSError *error = nil;

        audioRecorder = [[AVAudioRecorder alloc]
                         initWithURL:soundFileURL
                         settings:recordSettings
                         error:&#38;error];

        if (error)
        {
            CCLOG(@&#34;error: %@&#34;, [error localizedDescription]);

        } else {
            [audioRecorder prepareToRecord];
            [audioRecorder record];
        }</code></pre>
<p>I know this can be done I just don't know how, I did google and what comes up mostly is the "blow on mic" examples.</p>
<p>Thanks<br />
-N
</p></description>
		</item>
		<item>
			<title>linuus on "NSOSStatusErrorDomain Code=-50 ?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19077#post-106939</link>
			<pubDate>Mon, 25 Jul 2011 18:14:13 +0000</pubDate>
			<dc:creator>linuus</dc:creator>
			<guid isPermaLink="false">106939@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Today, after messing around with saving highscores, suddenly my application will not run at all.<br />
I get the following message in the log:</p>
<pre><code>2011-07-25 20:09:46.622 Hover[1217:207] Denshion::CDAudioManager - Audio session set category
 AVAudioSessionCategorySoloAmbient failed with error Error Domain=NSOSStatusErrorDomain Code=-50
&#34;The operation couldn’t be completed. (OSStatus error -50.)&#34;
2011-07-25 20:09:46.624 Hover[1217:207] Denshion::CDSoundEngine - mixer output rate set to 44100.00
AudioStreamBasicDescription:  2 ch,  44100 Hz, &#39;lpcm&#39; (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved</code></pre>
<p>Seams like some kind of problem with the audio, which is weird as I haven't made any changes to the music. </p>
<p>Help?
</p></description>
		</item>
		<item>
			<title>hayk01 on "create ipa file with xcode 3.2.4"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19436#post-108799</link>
			<pubDate>Thu, 04 Aug 2011 11:38:54 +0000</pubDate>
			<dc:creator>hayk01</dc:creator>
			<guid isPermaLink="false">108799@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>i developed application and i want to use it in my ipad<br />
i create a folder Payload add Myapp.app compress it and renaim Myapp.ipa<br />
but when want to send ipad say INVALID IPA<br />
im using xcode 3.2.4<br />
build and archive is disables if i set active sdk simulator<br />
when i set active sdk device build and archive enabled but i get eror</p>
<p>    CodeSign error: code signing is required for product type 'Application' in SDK 'Device - iOS 4.1'
</p></description>
		</item>
		<item>
			<title>eduhcano on "SimpleAudioEngine and mono sounds"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19228#post-107797</link>
			<pubDate>Fri, 29 Jul 2011 12:12:11 +0000</pubDate>
			<dc:creator>eduhcano</dc:creator>
			<guid isPermaLink="false">107797@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>When I play a mono effect, the sound only plays by right earphone, is there any way to play the sound in both earphone? When I play that effect in my iMac plays by both earphones.
</p></description>
		</item>
		<item>
			<title>saikumar on "Need help in playing player walking sound in loop continuously."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18911#post-106010</link>
			<pubDate>Wed, 20 Jul 2011 12:39:46 +0000</pubDate>
			<dc:creator>saikumar</dc:creator>
			<guid isPermaLink="false">106010@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>         i have to play player walking sound in loop continuously .can any body help me.</p>
<p>thanks in advance.
</p></description>
		</item>
		<item>
			<title>Azman on "Difference between CDLongAudioSource and AVAudioPlayer"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18783#post-105384</link>
			<pubDate>Sun, 17 Jul 2011 02:48:52 +0000</pubDate>
			<dc:creator>Azman</dc:creator>
			<guid isPermaLink="false">105384@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am using a long sound effect for my game and would like to<br />
pause the sound when the game is Pause. I'm currently using<br />
AVAudioPlayer and it works fine. I recently read about the<br />
CDLongAudioSource in the forum and wondering which is more<br />
effective?
</p></description>
		</item>
		<item>
			<title>mindnoise on "[CocosDenshion] Sound won&#039;t play on device with SimpleAudioEngine"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/14820#post-84152</link>
			<pubDate>Wed, 23 Mar 2011 22:45:11 +0000</pubDate>
			<dc:creator>mindnoise</dc:creator>
			<guid isPermaLink="false">84152@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey community,</p>
<p>I have a question for you guys, if any of you experienced something similar (and maybe managed to fix it), let me know please...</p>
<p>So, I play a sound with SimpleAudioEngine, nothing fancy:</p>
<pre><code>soundIdSoundSource = [[SimpleAudioEngine sharedEngine] soundSourceForFile:@&#34;woodblocks4th.wav&#34;];
[soundIdSoundSource play];</code></pre>
<p>The thing is, it works fine on simulator but not on device. I checked the volume and the silent on/off button of course.. More that that, [soundIdSoundSource play] returns YES (1). Anyone has any idea?
</p></description>
		</item>
		<item>
			<title>3kofstudio on "[GAME] - Open You Eyes"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18257#post-102346</link>
			<pubDate>Sat, 02 Jul 2011 10:31:57 +0000</pubDate>
			<dc:creator>3kofstudio</dc:creator>
			<guid isPermaLink="false">102346@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>A new ape is on the app store... <a href="http://tiny.cc/iw12j" rel="nofollow">http://tiny.cc/iw12j</a></p>
<p>Help Eko, in this fun, addictive, logic and eco friendly game,<br />
to save his rainforest and make it green again.</p>
<p>You have 5 maps, 12 puzzles in a map, 3 levels of difficulty - total of 180 puzzles and hours of fun.</p>
<p>Under the hood everything is cocos2d engine, the spirits, background and the speed controlling ability...<br />
Using the CocosDenshion library I managed to create  a very flexible background equalizer that allows you to change<br />
all the sounds of the forest and make it the way you want.</p>
<p>Check out my story on my web site, I think you will be surprised :)<br />
<a href="http://www.3kof.com/about.html" rel="nofollow">http://www.3kof.com/about.html</a></p>
<p>Here is the game trailer -<br />
<a href="http://www.youtube.com/watch?v=foSsGP_jfaM" rel="nofollow">http://www.youtube.com/watch?v=foSsGP_jfaM</a></p>
<p>and the game play movie -<br />
<a href="http://www.youtube.com/watch?v=EBOAZ6hR3zk" rel="nofollow">http://www.youtube.com/watch?v=EBOAZ6hR3zk</a></p>
<p>This is my first game ever made, and my learning only started... :)<br />
So... Reviews, Feedbacks, defects or any kind of remark will be gladly accepted.</p>
<p>Save the trees :)
</p></description>
		</item>
		<item>
			<title>jsupps on "Simple Audio Engine - continue playing music on startup"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17943#post-100697</link>
			<pubDate>Fri, 24 Jun 2011 01:22:54 +0000</pubDate>
			<dc:creator>jsupps</dc:creator>
			<guid isPermaLink="false">100697@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I was wondering if there was a way to continue to play the background music, say from Pandora, once my game has started up.  I would like it to work the same way when playing a song from my library.  In that case, the music continues to play, but my sound effects also play.  If I have Pandora running and then start up my game, pandora closes.</p>
<p>Any ideas?</p>
<p>Thanks<br />
John
</p></description>
		</item>
		<item>
			<title>zombie on "Minimal Delay between Sounds"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1946#post-12162</link>
			<pubDate>Fri, 18 Sep 2009 09:34:11 +0000</pubDate>
			<dc:creator>zombie</dc:creator>
			<guid isPermaLink="false">12162@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>is it possible to set a minimal time between sounds of the same group?</p>
<p>I play a sound when a collision occourse, but this can happen very often and with only minimal time inbetween.</p>
<p>Currently I have a timer running which toggles a variable. I check this to see if I should play the sound or not. But this is not build into the soundsystem and I need it a several places.</p>
<p>I ssomething like this possible already with CocosDenshion? </p>
<p>zombie
</p></description>
		</item>
		<item>
			<title>frilla on "looping background music from a specific time"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17434#post-98028</link>
			<pubDate>Wed, 08 Jun 2011 18:36:55 +0000</pubDate>
			<dc:creator>frilla</dc:creator>
			<guid isPermaLink="false">98028@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm trying to play a background music that has an intro and then a looping part both in the same audio file. So I want play the music file once and every time it loops afterwards, it would loop from a specific time in the audio file. </p>
<p>So far, I've tried the following way by quickly modifying "rewind" in CDLongAudioSource to do some test:<br />
<pre><code>-(void) rewind {
    [audioSourcePlayer pause];
	[audioSourcePlayer setCurrentTime:16.556];
    [audioSourcePlayer play];
}</code></pre>
<p>and then in audioPlayerDidFinishPlaying, i call this rewind function. It works, but I can hear that it's not smooth and the glitch is noticeable. </p>
<p>I also tried calling rewind when I touch the screen to test it randomly and it's also not smooth. </p>
<p>Is this expected or is it possible to have something seemless and smooth? If I cut the audio file in 2 parts and play them one after the other, can I expect better result?</p>
<p>I tried with a .mp3 file and a .aifc file, both with the same result. In iTunes, with this audio file, if i specify a start time and play it on loop, it's pretty smooth so I think the sound file is ok.
</p></description>
		</item>
		<item>
			<title>nomad_games on "Detecting a &quot;blow&quot; from microphone input"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17304#post-97369</link>
			<pubDate>Sun, 05 Jun 2011 17:27:54 +0000</pubDate>
			<dc:creator>nomad_games</dc:creator>
			<guid isPermaLink="false">97369@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all,</p>
<p>I am starting a new game in which I want the player to be able to blow into the mic and cause in-game events to happen.  I did some searching around on the web, and there are some posts on this, but everything seems to be well over a year old.  All I really need is to generate a variable (1-100) that is based on the level of noise picked up by the mic.</p>
<p>Can anyone point me in the right direction to get started with this?</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>argv0 on "playeffect overloaded?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2787#post-17279</link>
			<pubDate>Tue, 03 Nov 2009 15:59:49 +0000</pubDate>
			<dc:creator>argv0</dc:creator>
			<guid isPermaLink="false">17279@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>We're having a strange sound problem in our game.  One of the secret levels has tons of collectible objects (all packed close together) so as you walk through the area, the collect sound plays quite frequently - sometimes up to 4 times at once.</p>
<p>So partway through the level, sometimes all the collect sounds will just stop, and not play again for the rest of the level.  It kind of feels like denshion is being overloaded and can't handle all the playback, but its the same sound every time.</p>
<p>And to make it even stranger, at the end of the level the "level complete" background plays, and then all of a sudden the sounds start working again.</p>
<p>Its really confusing me and I know very little about what's happening, any help would be appreciated.
</p></description>
		</item>
		<item>
			<title>alex on "easiest way to add sound?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1218#post-7329</link>
			<pubDate>Sun, 09 Aug 2009 09:36:47 +0000</pubDate>
			<dc:creator>alex</dc:creator>
			<guid isPermaLink="false">7329@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi!</p>
<p>What's the easiest way to add sound to my game e.g. background music and sounds on actions?</p>
<p>Thanks<br />
-Alex
</p></description>
		</item>

	</channel>
</rss>

