iPhone播放声音

 

	NSString *path = [[NSBundle mainBundle] pathForResource:@"crunch" ofType:@"wav"]; //读取文件路径

	SystemSoundID soundID;

	AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &soundID); //分配声音ID

	AudioServicesPlaySystemSound (soundID); //播放声音

 

你可能感兴趣的:(iPhone)