默认SystemSoundID列表

I'm trying to implement AudioServicesPlaySystemSound(SystemSoundID(****)) therefor I need a list of existing IDs for Apples SystemSounds. Searching through various posts I found this on GitHub. I couldn't find a fitting sound in this list for my purpose. Since this repository wasn't updated since 2013 I'm not sure if its up to date. I would like to know if there is a list of SystemSounds which is more up to date.

评论
红颜祸水
红颜祸水

首先,您发现的列表不是Apple发布的。 我不知道作者是自己研究还是仅仅收集了它们,但是这种行为被认为是一种逆向工程,受到​​开发者协议的禁止。

我无法在此列表中找到适合我的声音。

You may need to find a sound resource instead of SystemSoundID, and register it and create a SystemSoundID for it using AudioServicesCreateSystemSoundID.

我想知道是否有最新的SystemSounds列表。

The latest list of public SystemSoundID is here:

Alert Sound Identifiers

Constants

  • kSystemSoundID_Vibrate

    On the iPhone, use this constant with the AudioServicesPlayAlertSound function to invoke a brief vibration. On the iPod touch, does nothing.

  • kSystemSoundID_UserPreferredAlert

    On the desktop, use this constant with the AudioServicesPlayAlertSound function to play the alert specified in the Sound preference pane.

  • kSystemSoundID_FlashScreen

    On the desktop, use this constant with the AudioServicesPlayAlertSound function to display a flash of light on the screen.

  • kUserPreferredAlert

    Deprecated. Use kSystemSoundID_UserPreferredAlert instead.

(其中一些仅用于macOS。)

使用其他SystemSoundID可以视为使用私有API。

苹果开发人员在苹果开发论坛中的一些评论:

Does this count as a private API?

在API中使用未记录的任意值是不合适的,因此我建议您在提交时不要这样做。

Haptic feedback for force touch?

若要将固定的SystemSoundID值视为API,它在标头中必须具有符号常量。传递其他固定值是不正确的。
点赞
评论