系統(tǒng)音頻播放
震動
//id = 1520 是3d touch的pop震動反饋蛆楞,id = 1519 是3d touch的peek震動反饋
//id = kSystemSoundID_Vibrate 是系統(tǒng)聲音
SystemSoundID soundID = kSystemSoundID_Vibrate;
AudioServicesPlaySystemSound(soundID)
播放系統(tǒng)聲音
//soundID 1000-
AudioServicesPlaySystemSound(soundID)
播放自定義音頻
//自定義音頻地址
CFURLRef urlRef;
//為自定義音頻記錄id
SystemSoundID soundID;
//創(chuàng)建id
AudioServicesCreateSystemSoundID(urlRef, &soundID)
//播放
AudioServicesPlaySystemSound(soundID)
自定義音頻支持.mp3,.wav等格式叛赚,但是音頻長度建議在30秒內,不可過長