AVAudioFormat is a pretty simple class and very convenient.
"Standard Format” is what they want you to use going forward, which is from the docs: deinterleaved native-endian float (AVAudioPCMFormatFloat32)
Use either initStandardFormatWithSampleRate:channelLayout:
or initStandardFormatWithSampleRate:channels:
The initWithCommonFormat:… methods provide for using a few other common presets. Otherwise you’d need the dictionary approach. To get an ASBD just call the method streamDescription Other details can be retrieved as easily.
You can also create an AVAudioFormat object from an ASBD. initWithStreamDescription:
Then it’s very easy to introspect it.
In this way, it’s really easy to add this to your code.
On Jan 10, 2015, at 12:38 AM, Robert Carroll < email@hidden> wrote:
Hi,
At the tail end of WWDC 2014 session 501, Doug Wyatt mentions in passing that these new classes can be integrated into existing core audio code. Has anyone found any examples/ documentation on how to accomplish this?
iOS 8 has broken the audio output of my audiograph code. I assume its has something to do with the deprecated audiosampletype and audiounitsampletype. On Mac OS I’ve changed these references to Float 32 and everything works as expected. For iOS 7 and earlier float 32 resulted in dangerous full volume white noise output. I found that Sint 32 worked, but apparently not for iOS8.
The developer session states that there is now a common audio format between OS X and iOS, so hopefully Float 32 with the same flags I’m using for Mac will solve the iOS 8 problem, but will require more branching code to continue to support iOS 6 - 7.
thanks,
rob
Robert Carroll RSM Records Toronto
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
|