Search code examples
callbackios8core-audio

AudioUnitSampleType deprecated on iOS8, my render callback is not working now


I have an app that throws samples in a render callback using AudioUnitSampleType. It's deprecated on iOS 8, and the sound is not working now. Previous iOS versions worked perfect. I can't find any documentation on how to replace AudioUnitSampleType.

The only info i got is the xcode warning ... "The concept of canonical formats is deprecated"

Please, help, can anyone put some light on how to fix it ?


Solution

  • I've the same issue. You can replace AudioUnitSampleType with SInt32. I guess you have declared AudioStreamBasicDescription too, so replace your declaration from streamFormat.mFormatFlags = kAudioFormatFlagsAudioUnitCanonical; to streamFormat.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked | kAudioFormatFlagIsNonInterleaved;

    Hope it will help.

    EDIT:

    You can also use typealias to define AudioUnitSampleType

    EDIT: You also may consider switching to TheAmazingAudioEngine