Hello. First, thanks for the StackOverflow team, cause it's a very useful website, since i'm developping on iPhone. Secondary, please excuse my language. I'm a frenchie and like every frenchies i'm very bad in english.
I've a very strange problem with my sounds in my iPhone program : I implemented a class which play a short sound in aiff. Here it is :
@implementation SoundPlayer
-(id)initWithFile:(NSString*)file{
self = [super init];
NSString *soundPath = [[NSBundle mainBundle] pathForResource:file ofType:@"aiff"];
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath: soundPath], &soundID);
return self;
}
-(void)play {
if(SOUND_ACTIVATED){
AudioServicesPlaySystemSound (soundID);
}
}
-(void)dealloc{
[super dealloc];
}
@end
It works quite good, but even if my instances are initialized the same way, they are not in the same audio stream !
I noticed that because when I push the volume+ and volume- buttons of the iPhone, in some cases it controls the main audio stream, in other cases it controls the ring volume. If I put the main stream to volume 0, sound A won't be hearable, but sound B will be.
Did someone have a similar problem ? Do you have any idea ?
Thanks a lot.
Martin