Re: Changing the default input/output device
Re: Changing the default input/output device
- Subject: Re: Changing the default input/output device
- From: William Stewart <email@hidden>
- Date: Tue, 10 Nov 2009 17:08:38 -0800
But, please don't do this.
The user sets this in a sound preference (in UI) and this affects
iTunes, QT and other playback systems (including games) that rely on
this value that the user has control over.
You should just play to the default device, or if that's not what you
want, then play to any device you like (with I presume your own UI)
but don't set the default device (or show UI to do that).
Bill
On Nov 10, 2009, at 3:48 PM, Jeff Moore wrote:
Presuming you know which device you want to set as the default
device, you would actually set it with code like this:
OSStatus SetDefaultOutputDevice(AudioObjectID inDeviceID)
{
AudioObjectPropertyAddress theAddress =
{ kAudioHardwarePropertyDefaultOutputDevice,
kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
UInt32 theSize = sizeof(AudioObjectID);
return AudioObjectSetPropertyData(kAudioObjectSystemObject,
&theAddress, 0, NULL, &theSize, &inDeviceID);
}
On Nov 10, 2009, at 3:36 PM, Florian Winterstein wrote:
I would like to change the default input or output devices from my
application but I did not find any documentation or examples on how
to do it.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden