Re: change default system output device
Re: change default system output device
- Subject: Re: change default system output device
- From: Kaan Erdener <email@hidden>
- Date: Thu, 7 Jun 2007 21:32:52 -0500
I did have "Play alerts and sound effects through" set to "selected
sound output device", so I manually chose built-in speakers. Without
changing anything else, my utility will successfully modify the sound
output device on the Sound Effects tab (of System Prefs > Sound), but
does not have any affect on the "Output" tab.
Is there perhaps a different flag I should use instead of
kAudioHardwarePropertyDefaultSystemOutputDevice if I want to set the
output device under the Sound > Output tab?
thanks,
Kaan
On Jun 7, 2007, at 1:23 PM, Jeff Moore wrote:
Most likely, somebody else is changing the default device after you
are changing it. The Sound Prefs panel will do just this when the
"Play alerts and sound effects through:" pop-up menu is set to
"Selected sound output device". You can use a different application
that doesn't do this, like Audio MIDI Setup or HALLab, to see the
effect of your change.
BTW, you can find out about when this happens by installing a
listener on the property.
On Jun 7, 2007, at 9:22 AM, Kaan Erdener wrote:
I've written a small utility to show current / list all / change
the default system output device, and I've encountered something I
don't understand. My "show current device" stuff works fine, the
"list all devices" works fine, but the "change device" doesn't
work as expected. I don't see any errors, but what I want is to
change the system-wide output device, and that doesn't happen.
Here's what I'm doing:
// deviceIdData is char* that's set up elsewhere
AudioDeviceID deviceId = (UInt32) [[NSString
stringWithUTF8String:deviceIdData] intValue];
UInt32 size = sizeof(deviceId);
OSStatus err = AudioHardwareSetProperty
(kAudioHardwarePropertyDefaultSystemOutputDevice, size, &deviceId);
if (err != noErr) {
printf("error\n");
}
If I use an invalid input value for deviceIdData, I can generate
an error, so that's good. If I use a valid value, I see no errors,
and subsequent checks for "show current device" show the device
that I just set. But when I open System Preferences, there is no
change in output device. What am I missing?
I could make several guesses as to what's going on, haven't found
much info about this behavior, so any and all help would be
greatly appreciated.
--
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