AudioToolbox下的音频
文章目录
第一步:引进#import <AudioToolbox/AudioToolbox.h>
第二步:获取路径
NSString *path=[[NSBundle mainBundle]pathForResource:@"duanxin7.caf" ofType:nil];
NSURL *url=[NSURL fileURLWithPath:path];
SystemSoundID soundID=1;
第三部: 创建获取id
AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url), &soundID);
第四部:播放
AudioServicesPlaySystemSound(soundID);

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论