gpt4 book ai didi

ios - 如何播放日历警报声和弦(默认)?

转载 作者:行者123 更新时间:2023-12-03 01:38:47 30 4
gpt4 key购买 nike

我只找到经典的声音ID,但我需要Chord(默认)日历警报。如何播放声音? ks

#define systemSoundID 1315  
AudioServicesPlaySystemSound (systemSoundID);

最佳答案

日历警报应为:

#define systemSoundID 1005

Apple Audio Services : Predefined Sounds
Note: These are undocumented enum values, which means you should not rely on it for AppStore apps.



替代方法:
NSURL *fileURL = [NSURL URLWithString:
@"/System/Library/Audio/UISounds/nano/Alert_Calendar_Haptic.caf"];

SystemSoundID soundID;
AudioServicesCreateSystemSoundID((__bridge_retained CFURLRef)fileURL, &soundID);
AudioServicesPlaySystemSoundWithCompletion(soundID, NULL);
AudioServicesPlaySystemSoundWithCompletion(kSystemSoundID_Vibrate, NULL);

您还可以在应用程序包中包含音频文件,或从系统库中调用它。

oji Currently Available System Sounds (iOS 11)

关于ios - 如何播放日历警报声和弦(默认)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49241032/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com