【问题标题】:What is the user case for "kAudioHardwarePropertyTranslateUIDToDevice"“kAudioHardwarePropertyTranslateUIDToDevice”的用户案例是什么
【发布时间】:2015-05-27 15:27:40
【问题描述】:

根据

AudioHardware.h

kAudioHardwarePropertyTranslateUIDToDevice

此属性获取与具有给定 UID 的 AudioDevice 对应的 AudioObjectID。 UID 通过限定符作为 CFString 传入,而 AudioDevice 的 AudioObjectID 作为属性数据返回给调用者。请注意,如果 UID 不引用任何 AudioDevices,则不会返回错误。相反,此属性将返回 kAudioObjectUnknown 作为属性的值。

我想知道这个属性的用户案例是什么?

其实我也有疑问

kAudioHardwarePropertyPlugInList

kAudioHardwarePropertyTranslateBundleIDToPlugIn 我想知道我们在哪里可以找到关于这些属性的更详细的参考资料?

【问题讨论】:

    标签: macos core-audio


    【解决方案1】:

    这适用于您需要存储(例如在首选项中)为特定目的使用或选择的设备,然后在后续运行中找到该设备。它是对以下内容的补充:

    @constant       kAudioDevicePropertyDeviceUID
                        A CFString that contains a persistent identifier for the AudioDevice. An
                        AudioDevice's UID is persistent across boots. The content of the UID string
                        is a black box and may contain information that is unique to a particular
                        instance of an AudioDevice's hardware or unique to the CPU. Therefore they
                        are not suitable for passing between CPUs or for identifying similar models
                        of hardware. The caller is responsible for releasing the returned CFObject.
    

    因此,您将获取设备的 UID 并将其存储在您的首选项或文档中。然后,在后续运行或打开该文档时,您可以使用 kAudioHardwarePropertyTranslateUIDToDevice 从该 UID 中查找 AudioDevice 对象。

    【讨论】:

    • 感谢您的解释。请问可以举个例子吗?
    猜你喜欢
    • 2017-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-10
    • 1970-01-01
    相关资源
    最近更新 更多