user842059
user842059

Reputation: 73

AudioToolbox iPad problem

I am implementing AudioToolbox framework into my ipad app to try to play a sound effect. Here is my code: I declared a SystemSoundID called explode

NSURL *explodeURL = [NSURL fileURLWithPath:[[NSBundle mainBundle]  
                      pathForResource:@"Explosion" ofType:@"wav"]];
AudioServicesCreateSystemSoundID((__bridge CFURLRef) explodeURL, explode);    
[self performSelector:@selector(playsfx) withObject:nil afterDelay:2.0];

-(void)playsfx {
     AudioServicesPlaySystemSoundID(explode)
}

But for some reason the sound never plays.

Upvotes: 0

Views: 267

Answers (1)

meggar
meggar

Reputation: 1219

try passing the address of explode

AudioServicesCreateSystemSoundID((CFURLRef)explodeURL, &explode); 

Upvotes: 1

Related Questions