• 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: DefaultOutputUnit example on Intel Mac
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >DefaultOutputUnit example on Intel Mac (From: Matt Connolly <email@hidden>)
 >Re: DefaultOutputUnit example on Intel Mac (From: Brian Whitman <email@hidden>)
 >Re: DefaultOutputUnit example on Intel Mac (From: Matt Connolly <email@hidden>)

  • Prev by Date: Documentation on AUMixer
  • Next by Date: Re: Documentation on AUMixer
  • Previous by thread: Re: DefaultOutputUnit example on Intel Mac
  • Next by thread: Documentation on AUMixer
  • Index(es):
    • Date
    • Thread