When do i need to set kAudioUnitProperty_StreamFormat?

When to set kAudioUnitProperty_StreamFormat (and kAudioUnitProperty_SampleRate )? For every AU on my AUGraph? Or is it enough to install jus for AU Mixer?

Andre

+4
source share
2 answers

you set it to the inputs and outputs of each audio device.

iphone allows only signed ints to be entered. so don’t worry about floats, it just won’t work.

you set sampling rates using

CAStreamBasicDesciption myDescription;

myDescription.mSampleRate = 44100.0f; // and do this for other parameters, such as mBitsPerChannel, etc.

Audio devices, such as a mixer, output a fixed-point 8.24 format.

keep this in mind when you try to create callbacks and use the audiounitrender function, the formats must match, and you cannot change the output formats. (but you can install it anyway)

use printf ("Mixer file format:"); myDescription.Print (); for a description of the format. It will depend on where you put it in the initialization process.

+1
source

In short, yes - for more details on what you really need to install on each device, see the Audio Hosting Guide for iOS

0
source

All Articles