Re: PhysicalFormat vs. VirtualFormat
Re: PhysicalFormat vs. VirtualFormat
- Subject: Re: PhysicalFormat vs. VirtualFormat
- From: Jeff Moore <email@hidden>
- Date: Mon, 5 Dec 2005 14:39:12 -0800
If you look back in the archives a couple of weeks, I wrote something
about format handling. It provides good background, but I don't think
I discussed virtual and physical formats.
The difference between the physical format of a stream and the
virtual format is that the physical format represents what the
hardware is really using while the virtual format represents what
IOProcs for the device will see. The reason for the split is that for
the linear PCM format, it is convenient for most applications to do
processing using floating point samples whereas the vast majority of
hardware it is more convenient to use some kind of integer
representation. So whenever an IOProc encounters linear PCM, it
generally deals with it as a float regardless of what the underlying
representation the hardware is using. One interesting bit of fallout
of this is that the list of virtual formats is usually a lot shorter
than the list of physical formats since all the linear PCM formats
get reduced down to a single format.
So given that, apps should avoid presenting the user with the virtual
format. The users should deal with the format in the hardware's
terms. From there, it becomes natural for the application to always
deal with the physical format too (with the caveat that the IOProc
will be using floats).
On Dec 4, 2005, at 4:38 PM, Derk-Jan Hartman wrote:
For changing to encoded audio output mode, i need to change the
AudioStream format.
I currently do this by changing the physical format trough
AudioStreamSetProperty( stream, masterchannel etc)
However, reading how kAudioDeviceStreamFormats seems to become
kAudioStreamVirtualFormats, and how the selection works, i think
perhaps i should actually set kAudioDeviceStreamFormat /
kAudioStreamVirtualFormat on the AudioStream, instead of
physicalformat?
Or should i set/check both are cac3 ? in that case which should be
checked and set first?
What am i supposed to do (keeping 10.3 compatibility in mind).
I'm confused :D
--
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