开发者

AudioToolbox iPad problem

开发者 https://www.devze.com 2023-03-20 19:56 出处:网络
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

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 sou开发者_如何学Cnd never plays.


try passing the address of explode

AudioServicesCreateSystemSoundID((CFURLRef)explodeURL, &explode); 
0

精彩评论

暂无评论...
验证码 换一张
取 消