2017年7月29日 | Leave a comment 问题: iOS 播放wav 最简单的方式 解决: 不能播放过长文件 func playWav(_ wavName : String){ let wavUrl = Bundle.main.url(forResource: wavName, withExtension: nil)! var soundID : SystemSoundID = 0 ; AudioServicesCreateSystemSoundID(wavUrl as CFURL, &soundID); AudioServicesPlayAlertSound(soundID); } 123456 func playWav(_ wavName : String){ let wavUrl = Bundle.main.url(forResource: wavName, withExtension: nil)! var soundID : SystemSoundID = 0 ; AudioServicesCreateSystemSoundID(wavUrl as CFURL, &soundID); AudioServicesPlayAlertSound(soundID); } 参考: