Posts

Es werden Posts vom Januar, 2011 angezeigt.

De-interleaved stereo and AudioBuffers

For the version 2 of bcAnalyze I am digging much deeper into CoreAudio to be able to do some of the things I have planned. The first that bcAnalyze does when it encounters an AudioFile is reading its data into an internal SInt16 buffer. ExtAudioFileRead works well for that if the file format is wav, mp3, aiff or one of the other known formats. While version 1 of bcAnalyze asks the user which channel to read, I decided to overcome this limitation. Still, the UI should only display and work with one channel, but the user should be able to switch between left/right for display and such. Simple solution, tell ExtAudioFileRead to read the stereo data into two buffers, one for each channel. Setting the proper client format was simple. For my purpose the internal format / client formatFlag is set: clientFormat.mFormatFlags = (!kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked | kAudioFormatFlagIsNonInterleaved); Then, whenever I tried to read a stereo fi