我正在将AudioToolbox框架应用到我的ipad应用程序中,尝试播放声音效果。下面是我的代码:我声明了一个名为SystemSoundID的爆炸
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)
}但由于某种原因,声音从未播放过。
发布于 2011-07-16 01:04:39
尝试传递explode的地址
AudioServicesCreateSystemSoundID((CFURLRef)explodeURL, &explode); https://stackoverflow.com/questions/6710023
复制相似问题