Positional sound with SimpleAudioEngine

Forums Programming sound engine: CocosDenshion et al Positional sound with SimpleAudioEngine

This topic contains 3 replies, has 3 voices, and was last updated by  neigaard 2 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
Author Posts
Author Posts
March 23, 2012 at 8:55 am #240126

neigaard
Participant
@neigaard

Hi,

I am trying to implement positional sound with SimpleAudioEngine and I have it working well for gain, but it seems as if adjusting pan does nothing to the sound? For an experiment I do this:

CDSoundSource *expSound = [[SimpleAudioEngine sharedEngine] soundSourceForFile:@"Exp_Small.mp3"];

expSound.pan = 1.0f;

[expSound play];

I expected to have no sound in my left speaker, but I do have sound there and really I can not hear any difference wether pan is 0.0 or 1.0. I have tested both on simulator and on real device, same result.

What is wrong here?

March 23, 2012 at 11:19 am #369749

Steffen Altwiese
Moderator
@steve-oldmeadow

You can only adjust the pan of mono sounds so my guess is you are using a stereo sound. If you want to do positional audio I’d recommend using an engine that is designed for it like ObjectAL http://kstenerud.github.com/ObjectAL-for-iPhone/

March 23, 2012 at 12:21 pm #369750

fabiorodella
Participant
@fabiorodella

This might help :)

http://www.crocodella.com.br/2011/05/positional-audio-with-cocos2d-and-cocosdenshion/

March 23, 2012 at 1:58 pm #369751

neigaard
Participant
@neigaard

Yes I was thinking that this might be the problem, just converted the sounds to mono caf and it works great, thank you for the tip!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.