I just want to mention that in outputFormat above you're specifying the common format to be whatever the input format is, but if that's .otherFormat then the initializer will fail. I think it's better to specify one of the other values (e.g., .pcmFormatFloat32)