iOS点击按钮播放声音
2018-06-05 本文已影响9人
NapoleonY
概述
未完待续
代码
//播放声音
NSString *resoucePath = [[NSBundle mainBundle] pathForResource:@"声音文件名" ofType:@"wav"];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:resoucePath], &soundID);
AudioServicesPlaySystemSound(soundID);