Re: Proper API for selecting devices
Re: Proper API for selecting devices
- Subject: Re: Proper API for selecting devices
- From: Jeff Moore <email@hidden>
- Date: Fri, 19 Nov 2004 11:36:38 -0800
Here's what I wrote the last time. It still answers the question.
The HAL provides the list of available devices through the
kAudioHardwarePropertyDevices property. Then for each device, you can
query the kAudioDevicePropertyDataSource family of properties to
access the input source (e.g. line in or internal mic on my PB).
The Audacity guy is right when he says that the model on Mac OS X is
different than it is on Windows (probably Linux too, but I don't
really know) where the input sources for the hardware are treated in a
flat fashion. Mac OS X presents a more hierarchic model where the
source is accessed through the hardware it is attached to.
I should also point out that CD audio is not accessed through an audio
device on Mac OS X. It is accessed through the file system, so you'll
never find that source.
The HALLab sample code (/Developer/Examples/CoreAudio/HAL/HALLab) has
code that illustrates how to access the data source properties on a
device. If you are having problems with the control, please post a more
directed question about it and I'll be happy to help you out.
On Nov 19, 2004, at 5:54 AM, Rolf Nilsson wrote:
Hi,
I have exactly the same problem with my application.
I have recently added a drop down list for selecting in and output
devices.
Essential the same code as in the ComplexPlayThru example which works
fine on my dual G4 running OS X10.2.8 or 10.3.6
On computers that have a built in microphone only this device is
found, not the physical line-input. At least this is what users
reports.
So how should we detect all devices?
A workaround is to add an item in the drop down selection list that
just select the "default device" as set up in the system preferences
sound panel
(same as wavemapper/midimapper under Windows)
Rolf NIlsson
>
> I've been trying to use the open source "Audacity" app to record on
my
> Mac (both G5 dual 1GHz and 600MHz G3 iBook), but it inserts all sorts
> of clicks and noise when it records, even though the freeware "Audio
> In" application records just fine.
>
> Audacity has a drop-down list of devices to use for input, but under
OS
> X this list doesn't do anything. You have to go into preferences to
> choose the device, and even then you don't have the option to select
> the "mic in" or "line in" mode like you can from Apple's System
> Preferences.
>
> I e-mailed the Audacity list, and I got the response below. The
> response made me think that perhaps there would be someone on this
list
> that would know the proper way to get a list of inputs for the
various
> devices that are available for audio in. Then the Audacity guys
could
> add that into the code and select devices properly.
>
> Let me know if you have suggestions, and/or send them to:
> email@hidden.
>
> Thanks!
>
> >
> > There is an odd confusuion in the way OS X does audio I/O. Whilst
you
> > can select between different audio input devices (sound cards, USB
> > etc) there is no functional API for programs to change which input
is
> > used on a given device (CD, line, mic on a single card). This is
set
> > from a drop-down list on the toolbar when audacity is run on other
> > OSes.
> >
> >> But even if we have to choose the device in the Preference menu,
it
> >> appears that Audacity doesn't currently get a full list of what is
> >> available, and thus may be trying to grab from the wrong source.
> > I'm guessing you should be setting the device to the Onkyo in the
> > audacity preferences, and then you will get the line or mic input,
> > dependant on the setting in Mac OS. Not very elegant, but as I say,
> > the interface is not consistent with other OSes (where the device
and
> > source choices are independant).
> >
> > Richard Ash
>
>
_______________________________________________
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
--
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