簡體   English   中英

OS X:響應新的音頻設備

[英]OS X: respond to new audio device

當OS X上出現新的音頻設備時,我需要收到通知。我不知道從哪里開始。 Core Audio可以為我做這個,還是我需要使用例如IO Kit降低到更低的水平?

您可以通過觀察kAudioHardwarePropertyDevices來完成此kAudioHardwarePropertyDevices 代碼看起來大致如下:

AudioObjectPropertyAddress propertyAddress = {
        .mSelector = kAudioHardwarePropertyDevices,
        .mScope = kAudioObjectPropertyScopeGlobal,
        .mElement = kAudioObjectPropertyElementMaster
    };

OSStatus result = AudioObjectAddPropertyListener(kAudioObjectSystemObject, &propertyAddress, myAudioObjectPropertyListenerProc, NULL);

myAudioObjectPropertyListenerProc您可以確定當前可用的設備。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM