Dumb Question from Analog Hardware Engineer

Discuss the development and future direction of Play.
Post Reply
Charles Hansen
Posts: 4
Joined: Sun Nov 15, 2009 11:20 pm

Dumb Question from Analog Hardware Engineer

Post by Charles Hansen » Mon Nov 16, 2009 12:35 am

Hello Stephen,

I have read that Play converts the audio data on the hard drive to 32-bit floating point for use in CoreAudio. Please excuse the dumb question, as I am just an analog hardware guy. Would it be possible to simply transfer the audio data as integers to the output port (eg, USB) without converting to floating point or even using CoreAudio at all?

I would assume so, as data for other uses is always transferred without conversion. What would be the pros and cons of doing it this way from a programming standpoint?

Thanks for your patience with this dumb question,
Charles Hansen

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: Dumb Question from Analog Hardware Engineer

Post by sbooth » Mon Nov 16, 2009 3:29 am

(I'm reposting this from an e-mail for posterity)

In OS X at the Core Audio level the canonical format is 32-bit floating point. If you want to use Audio Units, as Play does for DSP, you are required to hand them data in the canonical format. Similarly, the audio is converted from the canonical format to the device's format for output.

It would be possible to skip the conversion to float, by writing directly to the audio hardware, performing all your own buffering, etc. Of course, you would still have to convert to the hardware's desired format first.

CG
Posts: 37
Joined: Sat Apr 22, 2006 4:44 pm

Re: Dumb Question from Analog Hardware Engineer

Post by CG » Fri Nov 20, 2009 1:07 am

Another dumb question from another analog hardware engineer. (The two seem to be paired...)

In CoreAudio, if for example a 44.1 KHz 16 bit PCM file is sent to the CoreAudio engine, and Audio Midi settings are also set to 44.1 KHz 16 bits, does the data totally bypass the CoreAudio sample rate converter? Or, is it kind of resampled at a unity scaling factor 44.1 KHz 16 bit, 44.1 KHz 16 bit out)?

If it is resampled, can the quality and complexity level be adjusted? Or, can the re-sampling stage be bypassed entirely?

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: Dumb Question from Analog Hardware Engineer

Post by sbooth » Fri Nov 20, 2009 5:13 am

Man, you guys are self-deprecating!

Unfortunately, I don't really know the answers to those questions.

The sample rate converter used by Core Audio is adequately complex, so I think it is safe to assume that if the input and output sample rates are equal that no sample rate conversion is performed.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests