Re: DefaultOutputUnit example on Intel Mac
Re: DefaultOutputUnit example on Intel Mac
- Subject: Re: DefaultOutputUnit example on Intel Mac
- From: Stephen Davis <email@hidden>
- Date: Thu, 13 Apr 2006 16:44:01 -0700
There is an enum kAudioFormatFlagsNativeEndian which you can use to
say the float data is native-endian and then swapping is not
necessary. No need to waste time with byte-swapping routines.
In fact, there is a convenience enum which is even simpler to use:
enum
{
kAudioFormatFlagsNativeFloatPacked = kAudioFormatFlagIsFloat |
kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked
};
32-bit IEEE floats are always native-endian in memory for a given
processor.
stephen
On Apr 13, 2006, at 2:45 PM, Matt Connolly wrote:
Thanks,
I just found that, but I tried this instead:
using CFSwapInt16HostToBig in the render thread, then at least the
code is endian safe.
Also, the bug seems to be that there is endian swapping on floats.
I thought 32-bit floats were always stored in the same IEEE format
regardless of integer endian. And yes, removing the
'kLinearPCMFormatFlagIsBigEndian' flag from the float samples makes
it work.
I guess your code has to be 'endian' aware when setting the flags
for the floats too....
Cheers,
Matt
On 14/04/2006, at 7:38 AM, Brian Whitman wrote:
There are three lines in RenderSin.cpp where
kLinearPCMFormatFlagIsBigEndian is ORed into the format flags.
Comment out those three lines... works for me here.
On Apr 13, 2006, at 5:30 PM, Matt Connolly wrote:
I've been having some trouble getting the 'DefaultOutputUnit'
example (supplied with CoreAudio SDK) to work correctly on an
Intel Mac. It works correctly on a PowerPC (iBook G4) but not on
MacBookPro.
Sound plays, but it is not a sine tone. There is lots of
distortion in the sound.
Any ideas?
Matt Connolly
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40media.mit.edu
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:
40apple.com
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