rnine / SimplyCoreAudio

πŸ”Š A Swift framework that aims to make Core Audio use less tedious in macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

allOutputDevices is returning input devices

ryanfrancesconi opened this issue Β· comments

Hi, just updated to your refactored framework. It looks good. I like the syntax changes you've made.

One thing... I noticed that

let devices = simplyCA.allOutputDevices

returns input devices:

1 🎀  MacBook Air Microphone (54) UID: BuiltInMicrophoneDevice 
 owning device id nil manufacturer Apple Inc. modelUID Digital Mic relatedDevices( [MacBook Air Microphone (54), MacBook Air Speakers (47)] output channels 0 input channels 1 output data sources nil input data sources [1768778083] controlList [56, 57, 58] isHidden( false has ownedObjectIDs true output jack connected nil input jack connected nil aggregateInputs:  [] aggregateOutputs [] 

2 πŸ‘₯ (Aggregate Device) 🎧+🎀  CADefaultDeviceAggregate-31643-0 (80) UID: CADefaultDeviceAggregate-31643-0 
 owning device id nil manufacturer Apple Inc. modelUID nil relatedDevices( [CADefaultDeviceAggregate-31643-0 (80)] output channels 2 input channels 1 output data sources nil input data sources nil controlList [] isHidden( false has ownedObjectIDs true output jack connected nil input jack connected nil aggregateInputs:  ["🎀 MacBook Air Microphone (83) UID:BuiltInMicrophoneDevice"] aggregateOutputs ["🎧 External Headphones (84) UID:BuiltInHeadphoneOutputDevice"] 

I looked at the source code and I don't see the problem though?

This works:

        simplyCA.allNonAggregateDevices.filter { $0.channels(scope: .output) > 0 }

outputs:

1 🎧  LG Ultra HD (65) UID: 1E6D095B-0000-0000-081B-0104B53C2278 
 owning device id nil manufacturer GSM modelUID nil relatedDevices( [LG Ultra HD (65)] output channels 2 input channels 0 output data sources nil input data sources nil controlList [67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79] isHidden( false has ownedObjectIDs true output jack connected nil input jack connected nil aggregateInputs:  [] aggregateOutputs [] 

2 🎧 πŸ‘‰ External Headphones (59) UID: BuiltInHeadphoneOutputDevice 
 owning device id nil manufacturer Apple Inc. modelUID Codec Output relatedDevices( [External Headphones (59)] output channels 2 input channels 0 output data sources [1751412846] input data sources nil controlList [61, 62, 63, 64] isHidden( false has ownedObjectIDs true output jack connected nil input jack connected nil aggregateInputs:  [] aggregateOutputs [] 

3 🎧  MacBook Air Speakers (47) UID: BuiltInSpeakerDevice 
 owning device id nil manufacturer Apple Inc. modelUID Speaker relatedDevices( [MacBook Air Speakers (47), MacBook Air Microphone (54)] output channels 2 input channels 0 output data sources [1769173099] input data sources nil controlList [49, 50, 51, 52, 53] isHidden( false has ownedObjectIDs true output jack connected nil input jack connected nil aggregateInputs:  [] aggregateOutputs [] 

Is the released SPM version a bit behind? I just did the default of:
image

oh nevermind, i see that it was in a PR and merged to develop!. Must not be in the main SPM yet...

commented

@ryanfrancesconi Yes, it hasn't been merged yet. I'll do a 4.0.1 release including this fix over the weekend. In the meantime you may use the develop branch. Thanks for the heads up πŸ‘