• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do you get the native bit-depth of the input device?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you get the native bit-depth of the input device?


  • Subject: Re: How do you get the native bit-depth of the input device?
  • From: Dave Fernandes <email@hidden>
  • Date: Fri, 10 Aug 2007 20:32:48 -0400

So if my user plugs in a complex device with multiple input streams, how can they tell me which one(s) they are using? I need to get and set bit-depths and sample rates for the correct stream. Is it possible to support multi-stream devices without specs from the device manufacturer?

On Aug 10, 2007, at 8:06 PM, Jeff Moore wrote:


On Aug 10, 2007, at 4:49 PM, Dave Fernandes wrote:

Thanks! It took me a while to figure out how to get this format info, but I think it is working. I'm using the "master channel" of the AudioDevice to get the AudioStream to get the format. Is this correct?

You're close. Format info in the HAL is handled differently than it is in AUHAL. Each audio device has some number of streams and each stream has it's own format. Thus, the format of the audio device is actually a vector of ASBDs, one for each stream. So, to get the format of the device, you'd do the following (in pseudo code):
Get the list of streams for the device
For each stream do
Get the physical format of the stream


By just getting the format of the first stream, you are only getting a partial picture of the format of the device. For devices that have only one stream in a given direction (like the built-in hardware), this will be fine. But for more complex hardware, it will leave you with just part of the info.


I can't find any documentation on what exactly a master channel is.

This is covered somewhat in <CoreAudio/AudioHardware.h>. But the short answer is that the HAL always numbers channels in streams starting with number 1. Number 0 is reserved for the "master" channel which is useful for controls or properties that apply to the entire scope or object involved.


In the case of the stream format stuff, getting the various device related format properties on the master channel gets you the information about the first stream of the device in the given direction.



Dave

On Aug 6, 2007, at 2:57 PM, William Stewart wrote:

In AudioHardware.h there are format descriptor properties for the virtual and physical formats of the device. The virtual format is normally the canonical Float32. The physical format is whatever the device is using.


On 02/08/2007, at 2:24 PM, Dave Fernandes wrote:

The AudioOutputUnit nicely provides a stream of Float32 samples. But I would like to choose the bit-depth of the file I am recording to based on the precision of the input device. So how can I determine this precision? The

--

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:
40utoronto.ca


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
  • Follow-Ups:
    • Re: How do you get the native bit-depth of the input device?
      • From: Jeff Moore <email@hidden>
References: 
 >How do you get the native bit-depth of the input device? (From: Dave Fernandes <email@hidden>)
 >Re: How do you get the native bit-depth of the input device? (From: William Stewart <email@hidden>)
 >Re: How do you get the native bit-depth of the input device? (From: Dave Fernandes <email@hidden>)
 >Re: How do you get the native bit-depth of the input device? (From: Jeff Moore <email@hidden>)

  • Prev by Date: Re: How do you get the native bit-depth of the input device?
  • Next by Date: Re: How do you get the native bit-depth of the input device?
  • Previous by thread: Re: How do you get the native bit-depth of the input device?
  • Next by thread: Re: How do you get the native bit-depth of the input device?
  • Index(es):
    • Date
    • Thread