开发者

Playing sound issue iPhone?

What's wrong with this code? I've used it before but now I'm getting these warnings...

warning: passing argument 2 of 'AudioServicesCreateSystemSoundID' from incompatible pointer type

warning: passing argument 1 of 'AudioServicesPlaySystemSound' makes integer from pointer without a cast

-(void)playfireSound{

    NSString *path = [[NSBundle m开发者_JAVA百科ainBundle] pathForResource:@"fireSound" ofType:@"wav"];
    NSURL *url = [NSURL fileURLWithPath:path];
    AudioServicesCreateSystemSoundID((CFURLRef) url, &fireSound);   
    AudioServicesPlaySystemSound(fireSound);
}


Your declaration of your fireSound variable is probably incorrect for use with this API. Maybe you declared it as an object of some sort, instead of as an SystemSoundID, which is of type int.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜