<?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: SimpleAudioEngine - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/simpleaudioengine</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:34:58 +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/simpleaudioengine/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>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>michail on "SimpleAudioEngine&#039;s playEffect turns off ipod music."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18959#post-106300</link>
			<pubDate>Thu, 21 Jul 2011 22:07:37 +0000</pubDate>
			<dc:creator>michail</dc:creator>
			<guid isPermaLink="false">106300@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>How do I set things up so that SimpleAudioEngine's playEffect plays along with the ipod music rather than turning it off?
</p></description>
		</item>
		<item>
			<title>CCOak on "Problems with SimpleAudioEngine in iOS 5 &quot;Need Help&quot;"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17807#post-99923</link>
			<pubDate>Mon, 20 Jun 2011 00:35:04 +0000</pubDate>
			<dc:creator>CCOak</dc:creator>
			<guid isPermaLink="false">99923@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>After update firmware of my iPad to firmware 5.0 Beta<br />
My game didn't play a backgroundMusic(always)  or  get crash after backgroundMusic play around 10 second (Or maybe when I try to get music current time)</p>
<p>I try to change it to AVAudionPlayer but it doesn't help.</p>
<p>Please help me T_T</p>
<p>For example I try to run Ray Wenderlich's sample project "http://d1xzuxjlafny7l.cloudfront.net/downloads/BasicSounds.zip" and the backgroundMusic didn't play in my 5.0 device too but has no problem with 4.3
</p></description>
		</item>
		<item>
			<title>vishalavalani on "What is use of preload effect in SimpleAudioEngine"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25683#post-133730</link>
			<pubDate>Fri, 16 Dec 2011 13:07:19 +0000</pubDate>
			<dc:creator>vishalavalani</dc:creator>
			<guid isPermaLink="false">133730@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I read about preloading sounds in SimpleAudioEngine through<br />
[[SimpleAudioEngine sharedEngine] preloadEffect:@"bell.wav"];<br />
But, with this there are memory leaks which I read on couple of sites. On some websites it was used like this: -<br />
-(void)loadSoundFilesInBackground<br />
{<br />
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];</p>
<p>    [[SimpleAudioEngine sharedEngine] preloadEffect:@"bell.wav"];</p>
<p>    [pool release];<br />
}</p>
<p>What is the best way to load sound files in background through SimpleAudioEngine ? What is the use of NSAutoreleasePool here?
</p></description>
		</item>
		<item>
			<title>callispo on "SimpleAudioEngine warnings"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22337#post-123977</link>
			<pubDate>Tue, 01 Nov 2011 12:07:41 +0000</pubDate>
			<dc:creator>callispo</dc:creator>
			<guid isPermaLink="false">123977@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I keep getting these warnings: </p>
<p>Denshion::CDSoundEngine - WARNING sample rate does not match mixer sample rate performance will not be optimal.</p>
<p>Does this in any way affects my performance? Also, how can I fix this?
</p></description>
		</item>
		<item>
			<title>donutzeatpeople on "Calling [SimpleAudioEngine sharedEngine] outside of GameSoundManager"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22040#post-122503</link>
			<pubDate>Sat, 22 Oct 2011 15:49:20 +0000</pubDate>
			<dc:creator>donutzeatpeople</dc:creator>
			<guid isPermaLink="false">122503@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>I was previously using SimpleAudioEngine directly, however, I'd like to use GameSoundManager as the middleman.  I have some objects that usually will only trigger one sound effect, and then be released.  I read in another thread that @<a href='http://www.cocos2d-iphone.org/forum/profile/131'>Steve</a> Oldmeadow said that calling <code>[GameSoundManager sharedManager].soundEngine</code> is expensive, so   should I just call <code>[[SimpleAudioEngine sharedEngine] playEffect:@&#34;someEffect.caf&#34;]</code> directly?</p>
<p>The example of what I'm using is that I have extended CCMenuItemFont as CCMenuItemFont_Audio to play a sound effect once it has been touched:</p>
<p><code><br />
@implementation CCMenuItemFont_Audio</p>
<p>@synthesize soundEffectName = _soundEffectName;</p>
<p>-(void) activate<br />
{<br />
	// subclass to change the default action<br />
	if(isEnabled_)<br />
    {<br />
        [super activate];</p>
<p>        // Play sound effect<br />
		[[SimpleAudioEngine sharedEngine] playEffect:_soundEffectName];<br />
	}<br />
}<br />
@end<br />
</code></p>
<p>BTW, many thanks to @<a href='http://www.cocos2d-iphone.org/forum/profile/131'>Steve</a> Oldmeadow for creating this and supporting it in many threads in this forum
</p></description>
		</item>
		<item>
			<title>Ard on "having trouble with the BGM using SimpleAudioEngine, please help!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/14856#post-84344</link>
			<pubDate>Thu, 24 Mar 2011 20:34:37 +0000</pubDate>
			<dc:creator>Ard</dc:creator>
			<guid isPermaLink="false">84344@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I'm currently trying to get an on/off button for the music in my option scene to work, and for most part it works fine (including the simulator). However when I try it on the iPhone to test, one particular way causes it to bug. That is, </p>
<p>1. I turn off the music in options<br />
2. Press the iPhone Home button<br />
3. Start the game again<br />
4. The music boots up even if the option is turned off (and displayed as so in the option scene). </p>
<p>Here is my code</p>
<p>in the Starting Scene.m</p>
<p>MUSIC_ONOFF = [[NSUserDefaults standardUserDefaults] boolForKey:@"_MUSIC_ONOFF"];<br />
MUSIC_PERSIST = [[NSUserDefaults standardUserDefaults] boolForKey:@"_MUSIC_PERSIST"];</p>
<p>if (MUSIC_PERSIST == FALSE &#38;&#38; MUSIC_ONOFF == FALSE)</p>
<p>{</p>
<p>[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"Backgroumd_Music.mp3"];<br />
MUSIC_PERSIST = TRUE;<br />
[[NSUserDefaults standardUserDefaults] setBool:MUSIC_PERSIST forKey:@"_MUSIC_PERSIST"];<br />
[[NSUserDefaults standardUserDefaults] synchronize];</p>
<p>}	</p>
<p>in the Option Scene.m</p>
<p>- (void) doSomethingTwo: (CCMenuItem  *) menuItem </p>
<p>{</p>
<p>MUSIC_ONOFF = [[NSUserDefaults standardUserDefaults] boolForKey:@"_MUSIC_ONOFF"];<br />
[[CDAudioManager sharedManager].backgroundMusic setEnabled:NO];  //Sound Off</p>
<p>menuItem2.visible = NO;<br />
menuItem3.visible = YES;</p>
<p>MUSIC_ONOFF = TRUE;</p>
<p>[[NSUserDefaults standardUserDefaults] setBool:MUSIC_ONOFF forKey:@"_MUSIC_ONOFF"];<br />
[[NSUserDefaults standardUserDefaults] synchronize];</p>
<p>}</p>
<p>Please help! Thanks in advance.
</p></description>
		</item>
		<item>
			<title>drewjw81 on "Playing background music and multiple sound effects simultaneously"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21479#post-119359</link>
			<pubDate>Mon, 03 Oct 2011 15:14:19 +0000</pubDate>
			<dc:creator>drewjw81</dc:creator>
			<guid isPermaLink="false">119359@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm currently writing an app using cocos2d the requires three or more sounds to play simultaneously</p>
<p>I started with all my sounds in AAC format. I start the background music (AAC) using SimpleAudioEngine engine then I need to play multiple sound effects at the same the the problem is that the sound effects keep interrupting each other.</p>
<p>I attempted to remedy this but converting all the sound effects to IM4A caf files but they still continue to interrupt each other.</p>
<p>Finally I tried ObjectAL's OALSimpleAudio but still I'm having the same issue with the effects interrupting each other.</p>
<p>What am I missing?  Surely it must be possible to play more than two sounds at the same time.
</p></description>
		</item>
		<item>
			<title>oded on "Problem with SimpleAudioEngine"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21486#post-119387</link>
			<pubDate>Mon, 03 Oct 2011 18:43:32 +0000</pubDate>
			<dc:creator>oded</dc:creator>
			<guid isPermaLink="false">119387@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi, </p>
<p>I want to use SimpleAudioEngine for the music in a cocos2d game I'm working on.<br />
When I import SimpleAudioEngine.h in my game layer I get syntax errors in CVPixelBuffer.h and CMFormatDescription.h.<br />
I'v created a new clean cocos2d application and imported SimpleAudioEngine and it worked just fine, thus the error is in the code of my application.</p>
<p>What do you think causes the errors with SimpleAudioEngine ?<br />
How can I fix this?</p>
<p>Thanks,</p>
<p>Oded
</p></description>
		</item>
		<item>
			<title>znice on "SimpleAudioEngine: Unusual behavior w/ method playBackgroundMusic (loop:NO)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21430#post-119146</link>
			<pubDate>Sat, 01 Oct 2011 18:01:21 +0000</pubDate>
			<dc:creator>znice</dc:creator>
			<guid isPermaLink="false">119146@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I’m using SimpleAudioEngine to play audio in an application I've been working on for the last month and will be releasing in the coming days.  While addressing the last few outstanding bugs, I've noticed the following issue and, after hours of trying to resolve it on my own, decided I needed to get a forum account and ask here.</p>
<p>I've got a number of bg music and effect audio files that I'm managing using SimpleAudioEngine.  My application uses both cocos2d and UIKit components.  Among the UIKit components are a dynamic loading screen, home screen, and settings panel.  There's also a main c2d component (I'll call it the "game view") and whenever a view other than it is summoned I pause the global shared CCDirector.  It would be great to be able to also do a total freeze of the shared SimpleAudioEngine/CDAudioManager, but I haven't been able to find a way to do this (so, if you can instruct me how you can disregard the rest of this post...).  As I haven't figured out how to do this, I've instead been using SimpleAudioEngine's pauseEffect/pauseBackgroundMusic methods.  The issue I'm having is that SimpleAudioEngine's resumeBackgroundMusic method just invokes the backgroundMusic's (CDLongAudioSource) play method.  Consider the case where I begin playing a 10 second audio file by invoking [[SimpleAudioEngine] sharedEngine playBackgroundMusic:FILE loop:NO]...then, 20 seconds later the user pulls up the settings screen (at which point I invoke [[SimpleAudioEngine] sharedEngine playBackgroundMusic]), then he dismisses the settings screen -- if, when he dismisses the settings screen, we invoke [[SimpleAudioEngine] sharedEngine resumeBackgroundMusic], the current backgroundMusic just gets played from the beginning -- which I don’t want.  I was therefore thinking about grabbing the underlying AVAudioPlayer object (...[CDAudioManager sharedManager].backgroundMusic.audioSourcePlayer...) and looking at its currentTime property to determine, on resuming the “game view”, whether to invoke resumeBackgroundMusic (because we only want to do so if bgmusic were interrupted when we pulled up the settings view).  I began logging the currentTime and saw something weird: even when I’ve invoked “playBackgroundMusic:FILE loop:NO” on the SimpleAudioManager shared instance, the logged currentTime continues to loop on playback completion (as if the background music has just been muted after one iteration) so it’s useless to me.  </p>
<p>So my first question is “is this a bug?” -- shouldn’t the currentTime property of the underlying AVAudioPlayer for the background music freeze (at either “0” or the audio file’s duration) after it plays once with loop:NO?  The second question is, is there a straightforward way for me to freeze and resume all audio managed by the shared SimpleAudioEngine instance (background music and effects, maintaining playback position on resume)?</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>tanvirk on "Can&#039;t play mp3 file using SimpleAudioEngine"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19574#post-109467</link>
			<pubDate>Mon, 08 Aug 2011 19:32:01 +0000</pubDate>
			<dc:creator>tanvirk</dc:creator>
			<guid isPermaLink="false">109467@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi</p>
<p>I've got the following code in my game :</p>
<p>in my layer Init method:</p>
<p><code>[[SimpleAudioEngine sharedEngine]preloadEffect:@&#34;ActivateProbe.wav&#34;];</code></p>
<p>and at the appropriate point in my game :</p>
<p><code>[[SimpleAudioEngine sharedEngine]playEffect:@&#34;ActivateProbe.wav&#34;];</code></p>
<p>however, i never hear any sound, both in the simulator or on my iPod Touch itself (running on IOS 4.1). I'm using Cocos v1.0.1</p>
<p>In the debug output in Xcode, i do see the following :</p>
<p>AudioStreamBasicDescription:  2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved</p>
<p>i assume the audio engine is attempting to play the sound ?</p>
<p>I can hear sounds from other applications on my device btw
</p></description>
		</item>
		<item>
			<title>kbaren on "SimpleAudioEngine and iphone3g problem"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19568#post-109445</link>
			<pubDate>Mon, 08 Aug 2011 17:23:54 +0000</pubDate>
			<dc:creator>kbaren</dc:creator>
			<guid isPermaLink="false">109445@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>in my iphone3g simpleaudionengine can't play a sound in caf format, in ipad1 it works good:<br />
when app is starting then it's freez a second and then go without any sound:<br />
is there any specification for audio files to use in iphone and ipad versions?<br />
I'm using SoundConverter to convert files and i convert it by default settings:<br />
Here is my code "self.soundId=[[SimpleAudioEngine sharedEngine] playEffect:@"effect.caf"];"
</p></description>
		</item>
		<item>
			<title>EvilRabbit on "How to determine if a CDSoundSource has a valid source loaded?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18673#post-104772</link>
			<pubDate>Thu, 14 Jul 2011 07:36:56 +0000</pubDate>
			<dc:creator>EvilRabbit</dc:creator>
			<guid isPermaLink="false">104772@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>How do I determine if a soundsource is loaded before using it. I currently use:<br />
myAudio = [[[SimpleAudioEngine sharedEngine] soundSourceForFile:@"Shared_Audio.mp3"] retain];</p>
<p>I want to be able to check if the source has been unloaded from simpleaudioengine (using unloadeffect) before I try and play the file - as the there will be no audio.</p>
<p>Hope that makes sense.
</p></description>
		</item>
		<item>
			<title>michail on "SimpleAudioEngine vs TomTheTurret&#039;s GameSoundManager"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18949#post-106233</link>
			<pubDate>Thu, 21 Jul 2011 17:12:15 +0000</pubDate>
			<dc:creator>michail</dc:creator>
			<guid isPermaLink="false">106233@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>What's the point of the GameSoundManager in cocos2d-iphone-1.0.0/CocosDenshion/TestsAndDemos/TomTheTurret?</p>
<p>Why not just use SimpleAudioEngine directly?
</p></description>
		</item>
		<item>
			<title>michail on "SimpleAudioEngine preloading + overlapping sounds questions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18954#post-106263</link>
			<pubDate>Thu, 21 Jul 2011 19:25:50 +0000</pubDate>
			<dc:creator>michail</dc:creator>
			<guid isPermaLink="false">106263@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is preloading a hint or is it guaranteed to happen?  Also, is it possible for a sound to get unloaded behind the scenes due to memory pressure?</p>
<p>Is the playing of overlapping sound effects fully supported?  What if you play overlapping instances of the same sound file?
</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>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>soprof on "[[SimpleAudioEngine sharedEngine] playEffect:@&quot;*.wav&quot;] breaks my app :("</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/14837#post-84228</link>
			<pubDate>Thu, 24 Mar 2011 10:24:00 +0000</pubDate>
			<dc:creator>soprof</dc:creator>
			<guid isPermaLink="false">84228@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have Objects fling over the screen, when user taps an object - it explodes, using self-made animation(not CCAnimation or smt, self-made code for changing textures from array over time). It works fine.<br />
I tried to add a simple sound on exlode:</p>
<pre><code>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;SimpleAudioEngine.h&#34;
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;CDAudionManager.h&#34;
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;CocosDenshion.h&#34;
...
if (blowflag)
blowCount = blowCount +dt;

if (frame&#60;NOfFrames)
  {
  frame = (blowCount/timePerFrame)
  }

     if (blowSoundNotPlayed)
         {
         [[SimpleAudioEngine sharedEngine] playEffect:@&#34;explode.wav&#34;]; //without this line everything works fine, no sound ofc.
         blowSoundNotPlayed=0;
         }
...
return frame;</code></pre>
<p>As a result, i get no explode-animation(it works without that line), and my mic breaks, stops detecting blowsound. But sound works :D</p>
<p>Questions: Why it happens? Maybe i better use cacao instruments to play 1 freaking sound?</p>
<p>Thanks for any help
</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>
		<item>
			<title>Osiris on "SimpleAudioEngine"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1281#post-7750</link>
			<pubDate>Wed, 12 Aug 2009 19:01:46 +0000</pubDate>
			<dc:creator>Osiris</dc:creator>
			<guid isPermaLink="false">7750@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>[[SimpleAudioEngine sharedEngine] backgroundMusicVolume :0.5f];</p>
<p>Gives me a warning on "backgroundMusicVolume".  That method is in the SimpleAudioManager.h.  Is there a bug?
</p></description>
		</item>
		<item>
			<title>xspecial on "Play audio from URL"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16385#post-92397</link>
			<pubDate>Mon, 09 May 2011 16:09:12 +0000</pubDate>
			<dc:creator>xspecial</dc:creator>
			<guid isPermaLink="false">92397@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi to all, i was wondering if were possible to play effects from internet URL, and how...<br />
Thanks to all in advance!</p>
<p>Daniele
</p></description>
		</item>
		<item>
			<title>ado2000 on "[MAC] [CDLongAudioSource load_]: unrecognized selector starting application"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/12332#post-69455</link>
			<pubDate>Tue, 04 Jan 2011 13:39:40 +0000</pubDate>
			<dc:creator>ado2000</dc:creator>
			<guid isPermaLink="false">69455@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi, </p>
<p>I'm porting my iphone gane application to mac using cocos2d v0.99.5</p>
<p>The problem occur when i install the application an run it from the application folder.</p>
<p>This is the log:<br />
04/01/11 13.26.49	7emezzo mac[4389]	MacGLView loaded<br />
04/01/11 13.26.49	7emezzo mac[4389]	-[CDLongAudioSource load_]: unrecognized selector sent to instance 0x101822320<br />
04/01/11 13.26.49	7emezzo mac[4389]	-[CDLongAudioSource load_]: unrecognized selector sent to instance 0x101822320</p>
<p>If i run the application from xcode is all ok.</p>
<p>Any suggestion ?</p>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>jamescahall on "CDLongAudioSource &amp; SimpleAudioEngine"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16179#post-91310</link>
			<pubDate>Tue, 03 May 2011 06:42:43 +0000</pubDate>
			<dc:creator>jamescahall</dc:creator>
			<guid isPermaLink="false">91310@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have an app that is has two main sections:</p>
<p>1) A cocos2d menu + book with narration and music</p>
<p>2) A non-cocos2d navigation system with uiviews, etc.</p>
<p>In section 1, I have narration and music playing at the same time.  I currently initialize the audio as such for Narration (left channel):</p>
<pre><code>CDLongAudioSource *music = [[CDAudioManager sharedManager] audioSourceForChannel:kASC_Left];
		NSString *song = @&#34;001_Prologue.caf&#34;;
		[music performSelector:@selector(load:) withObject:song afterDelay:0.0];
		[music performSelector:@selector(play) withObject:nil afterDelay:3.0];
		music.volume = 0.1f;</code></pre>
<p>and for background music (right channel):</p>
<pre><code>CDLongAudioSource *playback = [[CDAudioManager sharedManager] audioSourceForChannel:kASC_Right];
			if (playback.isPlaying == NO) {
				[playback performSelector:@selector(load:) withObject:sound afterDelay:0.5];
				[playback performSelector:@selector(play) withObject:nil afterDelay:0.5];
			}</code></pre>
<p>And when pages are turned or menu items selected, end the audio as such:</p>
<pre><code>[CDAudioManager performSelector:@selector(end) withObject:nil afterDelay:0.5];</code></pre>
<p>Now, the problem I have is when I go back section 2) and use the SimpleAudioEngine for effect when buttons are pressed.</p>
<pre><code>[[SimpleAudioEngine sharedEngine] playEffect:@&#34;MenuStart.mp3&#34;];</code></pre>
<p>When I click this button the first time before loading the book section, it works fine.  If I return to the cocos2d section and then click the button a second time to go back to the non-cocos2d view controller, it crashes.</p>
<blockquote><p>[CDSoundEngine playSound:sourceGroupId:pitch:pan:gain:loop:]: message sent to deallocated instance 0x4d7b50</p>
</blockquote>
<p>If I get rid of the [CDAudioManager end] calls, the crash goes away, but I am unable to stop the sound consistently on the book pages with both left/right channels by using:</p>
<p>	`CDLongAudioSource *music = [[CDAudioManager sharedManager] audioSourceForChannel:kASC_Left];<br />
    [music stop];</p>
<p>	CDLongAudioSource *narration = [[CDAudioManager sharedManager] audioSourceForChannel:kASC_Right];<br />
    [narration stop];`</p>
<p>The audio seems to not stop right away and then when I go back to the page, the audio doesn't start again.</p>
<p>Any ideas?  Is there a way to reinitialize CDAudioManager after calling an end?  Is there a better way to stop all audio without calling end?  I have over a hundred pages in the book with over 3 hours of audio so I need to be able to completely remove the audio data after each page is turned.</p>
<p>Thanks<br />
James
</p></description>
		</item>
		<item>
			<title>wybielacz on "Different volume for different sounds effects"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15985#post-90149</link>
			<pubDate>Tue, 26 Apr 2011 22:27:38 +0000</pubDate>
			<dc:creator>wybielacz</dc:creator>
			<guid isPermaLink="false">90149@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>In my current WIP game I have some different sound effects. I am using SimpleAudioEngine to play them. I want to play one group of sound effects using a different volume level then another group. Could somebody point me to a direction how I could set the volume level not global but depending on the sound effect that I want to play ? Is this even possible ?
</p></description>
		</item>
		<item>
			<title>stamfa on "Detect if effect or music finishes - SimpleAudioEngine"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7693#post-45025</link>
			<pubDate>Wed, 07 Jul 2010 02:47:42 +0000</pubDate>
			<dc:creator>stamfa</dc:creator>
			<guid isPermaLink="false">45025@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello, I'm new to Objective-C and of course to cocos2d too. Although I am learning the language without problems, I encountered a problem related to the sound engine. I'm writing a little card game, and before the players start to play, a .WAV music plays <strong></strong><strong>and stops</strong>. The problem is that I don't know how to detect if that .WAV file finished, and I need to detect that in order to get the game started. I am using SimpleAudioEngine, with the effects preloaded. But if you give me another options to implement instead of SimpleAudioEngine, I have no problems.</p>
<p>Thank you for your time.
</p></description>
		</item>
		<item>
			<title>Igrek on "Weird sound effect volume behavior"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7704#post-45075</link>
			<pubDate>Wed, 07 Jul 2010 11:12:37 +0000</pubDate>
			<dc:creator>Igrek</dc:creator>
			<guid isPermaLink="false">45075@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi!</p>
<p>I'm writing a simple game for iPhone and I have some weird problems with sound effects volume.<br />
I have a shared class called "Sounds", which is responsible for playing all sound effects. There are two particular methods in it:<br />
<pre><code>-(void)playButton
{
	[[SimpleAudioEngine sharedEngine] playEffect:SND_BUTTON pitch:1.0f pan:0.0f gain:1.0f];
}</code></pre>
<p>which is called when button is pressed,<br />
and:<br />
<pre><code>-(void)playKlank:(float)volume
{
	[[SimpleAudioEngine sharedEngine] playEffect:SND_KLANK pitch:1.0f pan:0 gain:volume];
}</code></pre>
<p>which is called when two objects collide. I determine strength of the collision and adjust volume.<br />
I also do preloading in 'init' method:<br />
<pre><code>SimpleAudioEngine* audioEngine = [SimpleAudioEngine sharedEngine];
[audioEngine preloadEffect:SND_KLANK];
[audioEngine preloadEffect:SND_BUTTON];
[audioEngine setEffectsVolume:1.0f];</code></pre>
<p>and call <code>[Sounds sharedSounds]</code> at the beginning of my app delegate to preload sound effects.</p>
<p>Now, the weird part:<br />
1) First button sound effect is always quiet, something about 50% of the original volume. After that, next button sound effects are normal 100% volume.<br />
2) When I press button after two objects collided and 'klank' sound effect is still playing (it is something about 0.5 sec long) then the 'button' sound effect is at the same volume level as 'klank'. When I press button when 'klank' isn't playing, then the 'button' sound effect is normal 100% volume.</p>
<p>I use cocos2d in version 0.99.3, OpenFeint and iAds.<br />
I searched this forum, but didn't find an answer for my problem.<br />
Please help.</p>
<p>Cheers,<br />
Igrek
</p></description>
		</item>

	</channel>
</rss>

