• 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: iOS 8 ExtAudioFile AppleLossless distortion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iOS 8 ExtAudioFile AppleLossless distortion


  • Subject: Re: iOS 8 ExtAudioFile AppleLossless distortion
  • From: Robert Carroll <email@hidden>
  • Date: Mon, 12 Jan 2015 00:00:02 -0500

Hi,

Thanks for those comments, especially the link to the 64 bit conversion guide.

The ASBD I’m using is defined:

    size_t bytesPerSample = sizeof (AudioUnitSampleType);

    stereoStreamFormat.mFormatID          = kAudioFormatLinearPCM;
    stereoStreamFormat.mFormatFlags       = kAudioFormatFlagsAudioUnitCanonical;
    stereoStreamFormat.mBytesPerPacket    = (UInt32)bytesPerSample;
    stereoStreamFormat.mFramesPerPacket   = (UInt32)1;
    stereoStreamFormat.mBytesPerFrame     = (UInt32)bytesPerSample;    
    stereoStreamFormat.mChannelsPerFrame  = 2;                    // 2 indicates stereo
    stereoStreamFormat.mBitsPerChannel    = (UInt32)8 * (UInt32)bytesPerSample;    
    stereoStreamFormat.mSampleRate        = graphSampleRate;

using jump to definition on AudioUnitSampleType goes to this line in CoreAudioTypes.h:

CA_CANONICAL_DEPRECATED typedef SInt32      AudioUnitSampleType;

However, this is branched under CA_PREFER_FIXED_POINT. The other possibility being Float 32. There is an earlier comment in CoreAudioTypes.h 

// CA_PREFER_FIXED_POINT is true on iOS, but this is no longer true in general. This symbol may
// be removed in a future release.

I’m wondering about this because running CAShow on the audiograph shows the mixer to aunt connection as: 2 ch, 0 hz, ‘lpcm’ 32-bit little-endian float, deinterleaved

My graph structure on iOS is only the mixerAU connected to the ioUnit. I am setting callbacks on the mixer input buses and scaling the number of busses depending on how many files I need to play simultaneously. I am only setting the ASBD on the mixer unit’s input scope.

regards,

rob
On Jan 11, 2015, at 8:31 PM, Dave O'Neill <email@hidden> wrote:

Are there any other audio units in your chain?  Be sure to set the output ASBD of each audio unit to the input ASBD of the audio unit it is connected to (downstream).  Just as a troubleshooting technique you can try putting AUConverters between various audio units to see if that fixes things.  Maybe you could post your ASBD and we can spot an issue.  Instead of using AudioUnitSampleType just find out what it is typedef'd to and substitute it with that ( you can just highlight it and "jump to definition" in Xcode).  All of the iOS8 specific issues I've had were all traced back 32-64 bit issues. Here is a handy guide that points out some common gotchas: https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW1


On Sun, Jan 11, 2015 at 5:00 PM, Matt Hart <email@hidden> wrote:
I haven't tested with m4a lossless, but I have played about 14 or so lossless wav simultaneously as well as that many m4a compressed files. They are all buffered though.

On Jan 11, 2015, at 7:08 PM, Robert Carroll <email@hidden> wrote:

Hi.

Thanks. I am doing that with the same function call.

Further investigation is pointing to some other issue. My code that reads the ExtAudioFile objects is playing single m4a files, but not multiple files set up on different mixer buses. I was testing with a single A440.if file then with 3 m4a lossless files for C4, E4, G4 which should play simultaneously.

On iOS 7 it works, on iOS 8 I get a brief burst of vicious white noise. 

I’m inclined to think this is back to the storage type for the sample data. Since, I haven’t found an answer to a replacement for the AudioUnitSampleType on iOS, I had reverted my code to using that type.

rob

On Jan 11, 2015, at 6:25 PM, Matt Hart <email@hidden> wrote:

I use this with iOS 8 and 7 without any issues. Did you set the expected client data format onto the audio file property?

status = ExtAudioFileSetProperty(_audioFile, kExtAudioFileProperty_ClientDataFormat, sizeof(_targetAudioDescription), &_targetAudioDescription);


On Jan 11, 2015, at 1:56 PM, Robert Carroll <email@hidden> wrote:

I am attempting to narrow down the options why my audiograph code is failing on iOS 8. 

I am using ExtAudioFileRead to extract data from applelossless source files and load structs set up for this purpose.
The buffers and audioData parts of the struct are typed as AudioUnitSampleType.

All of this works as it should on iOS’s up to 7.x. Running on iOS 8.1.2 I can play aiff source files with this code but get distortion if I load the m4a (lossless) files.

What changed in iOS 8 with extaudiofile that would account for this issue?

thanks

rob


Robert Carroll
RSM Records
Toronto
http://www.rsmrecords.com


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


 _______________________________________________
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: 
 >iOS 8 ExtAudioFile AppleLossless distortion (From: Robert Carroll <email@hidden>)
 >Re: iOS 8 ExtAudioFile AppleLossless distortion (From: Matt Hart <email@hidden>)
 >Re: iOS 8 ExtAudioFile AppleLossless distortion (From: Robert Carroll <email@hidden>)
 >Re: iOS 8 ExtAudioFile AppleLossless distortion (From: Matt Hart <email@hidden>)
 >Re: iOS 8 ExtAudioFile AppleLossless distortion (From: "Dave O'Neill" <email@hidden>)

  • Prev by Date: Re: iOS 8 ExtAudioFile AppleLossless distortion
  • Next by Date: Re: iOS 8 ExtAudioFile AppleLossless distortion
  • Previous by thread: Re: iOS 8 ExtAudioFile AppleLossless distortion
  • Next by thread: Re: iOS 8 ExtAudioFile AppleLossless distortion
  • Index(es):
    • Date
    • Thread