Re: API for switching audio output device or disabling output altogether
Re: API for switching audio output device or disabling output altogether
- Subject: Re: API for switching audio output device or disabling output altogether
- From: Jeff Moore <email@hidden>
- Date: Fri, 11 Dec 2009 17:30:57 -0800
I should add that you would find out if the hardware allows you to switch back to the built-in speaker when something is plugged into the digital port by examining the structure of the built-in devices.
For example, on my MacPro, the digital output and the built-in speakers are actually separate devices. So switching between them is as easy as selecting the device you want from the HAL's device list and using it.
On some of our other hardware (like where the various outputs are represented in one device, like on my MacBook Pro), you would know if the choice is available by examining the kAudioDevicePropertyDataSource family of properties on the device. If the device offers the ability to switch between outputs, this control will reflect this by offering multiple items to choose from.
FWIW, you can examine the value of these properties visually in either Audio MIDI Setup or HALLab to see what the variations are without having to write any code.
On Dec 11, 2009, at 5:21 PM, Jeff Moore wrote:
> On our hardware that behaves in this way (and not all of our hardware does), the behavior is there because you physically can't use the digital out and the built-in speakers at the same time. There is no API, public or otherwise, for you to call to change this behavior short of pulling the cable.
>
> On Dec 11, 2009, at 5:10 PM, Roger Thornhill wrote:
>
>> On Fri, Dec 11, 2009 at 8:01 PM, Paul Davis <email@hidden> wrote:
>>> On Fri, Dec 11, 2009 at 7:21 PM, William Stewart <email@hidden> wrote:
>>>
>>>> That's the point though. The behaviour that we support is to support the
>>>> user's gesture (plugging the cable) and NOT having to:
>>>>
>>>> (1) Plug the cable
>>>> AND
>>>> (2) Go to a software panel and configure the output.
>>>
>>> Just to confirm what you said earlier - this only happens if the user
>>> had selected the optical out as the default output device, correct? If
>>> the user had not done this, the switch would not happen and audio
>>> would continue using the existing device until they changed the
>>> configuration, correct? Even as a confirmed linux-head, its hard for
>>> me see what could be wrong with that policy ...
>>
>> The problem I have is that by inserting the cable, it disables the
>> option to switch to the internal speakers. Not the fact that
>> inserting the cable switches the audio output to the device connected
>> to the cable. If that were the case, it wouldn't be a problem. I'd
>> just select the internal speakers when I want to use them. The
>> problem is that the internal speakers are no longer an option.
--
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