一个使 swift 系统声音播放更便捷的 Swift 库。
AudioToolBox
中的系统声音必须以数字方式指定,但不清楚该数值对应的声音是什么。 因此,我使其可以通过指定声音名称来播放声音。 这是通过分析系统文件获得的。
下表显示了 SystemSoundID 和声音名称之间的对应关系。 SystemSoundID 和声音名称对照表
import SystemSound
AudioServicesPlaySystemSound(.sentMessage)
SystemSound 在 MIT 许可证下发布。 请参阅 LICENSE