前端之家收集整理的这篇文章主要介绍了
Swift中播放短音频,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
var systemSoundID:SystemSoundID = 0; let path = Bundle.main.path(forResource: "composer_close",ofType: "wav") Au
dioServicesCreateSystemSoundID(NSURL.fileURL(withPath: path!) as CFURL,&systemSoundID) Au
dioServicesPlayAlertSound(SystemSoundID(systemSoundID))