You can change the default input and output devices on macOS in System 
Preferences or via API, but this isn’t what I want to do. I want to be able to 
capture audio from the non-default input and play audio to the non-default 
output. There are plenty of reasons to want to do this on the Mac which can 
have any number of audio devices connected at a time.

— Dominic

> On Sep 28, 2019, at 5:02 PM, Arshia Cont <[email protected]> wrote:
> 
> Thank you Dominic for sharing this.
> 
> Is this general to both OSX and iOS or an OSX issue only? on iOS we can 
> manage to route audio using AVAudioSession. I’m not an OSX guy that’s why I’m 
> asking and before I move everything to AVAudioEngine!
> 
>> On 28 Sep 2019, at 22:53, Dominic Feira via Coreaudio-api 
>> <[email protected] <mailto:[email protected]>> wrote:
>> 
>> Yes, this works if you are only using audio output. I am using the input and 
>> output at the same time. If you do this, then you are restricted to using 
>> the default input and output devices.
>> 
>> — Dominic
>> 
>>> On Sep 28, 2019, at 1:06 AM, Tamas Nagy <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Hi Dominic,
>>> 
>>> you can change the output to an AudioDeviceID on the AudioUnit of the 
>>> outputNode.
>>> 
>>>     OSStatus err = AudioUnitSetProperty([[audioEngine outputNode] 
>>> audioUnit],
>>>                                         
>>> kAudioOutputUnitProperty_CurrentDevice,
>>>                                         kAudioUnitScope_Global,
>>>                                         0,
>>>                                         &deviceId,
>>>                                         sizeof(AudioDeviceID));
>>> 
>>> This works for us for years now.
>>> 
>>> Hope this helps.
>>> 
>>> Best,
>>> Tamas
>>> 
>>>> On 2019. Sep 28., at 2:56, Dominic Feira via Coreaudio-api 
>>>> <[email protected] <mailto:[email protected]>> 
>>>> wrote:
>>>> 
>>>> For the record, DTS has confirmed that everything I have posted below is 
>>>> correct. AVAudioEngine can only be used with the default input and output 
>>>> devices. The fact that AVAudioEngine ever shipped for the Mac like this at 
>>>> all says a lot.
>>>> 
>>>> — Dominic
>>>> 
>>>>> I have been working with AVAudioEngine. 
>>>>> 
>>>>> By default the AVAudioEngine is using an aggregate audio device with the 
>>>>> default input/output as the subdevices. This makes sense so the entire 
>>>>> engine can run on a single clock.
>>>>> 
>>>>> Is it possible to set the input and output devices to use something other 
>>>>> than the system?s default input and output?
>>>>> 
>>>>> From experimentation, if I set the input or output to anything other than 
>>>>> an aggregate device it fails. If I change the input and output to use the 
>>>>> same aggregate device (that I created with non-default devices), it 
>>>>> works. However any time the default output or input of the system 
>>>>> changes, the engine?s input/output are set back to the aggregate device 
>>>>> set up by core audio that uses the default input/output, basically 
>>>>> overriding what I told the engine to do.
>>>>> 
>>>>> I hope that I?m missing something obvious, but I think I have run into 
>>>>> the limits of this API. For an API that has been on the Mac for several 
>>>>> years it is very limited.
>>>> 
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Coreaudio-api mailing list      ([email protected] 
>>>> <mailto:[email protected]>)
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/coreaudio-api/tamas.lov.nagy%40gmail.com
>>>>  
>>>> <https://lists.apple.com/mailman/options/coreaudio-api/tamas.lov.nagy%40gmail.com>
>>>> 
>>>> This email sent to [email protected] 
>>>> <mailto:[email protected]>
>>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Coreaudio-api mailing list      ([email protected] 
>> <mailto:[email protected]>)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/coreaudio-api/arshiacont%40antescofo.com
>>  
>> <https://lists.apple.com/mailman/options/coreaudio-api/arshiacont%40antescofo.com>
>> 
>> This email sent to [email protected]
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to