NSString *path = [NSString stringWithFormat:@"/System/Library/Audio/UISounds/photoShutter.caf"];
NSURL *audioPath=[NSURL URLWithString:path];
SystemSoundID soundId;
AudioServicesCreateSystemSoundID((__bridge CFURLRef)audioPath, &soundId);
AudioServicesPlayAlertSound(soundId);
播放系统声音
最新推荐文章于 2025-08-05 16:49:17 发布
本文介绍了一种使用Objective-C代码在iOS设备上播放系统预设声音的方法。通过创建NSURL实例指向特定的声音文件,并利用AudioServices API来播放指定的声音。

1万+

被折叠的 条评论
为什么被折叠?



