Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between CAStreamBasicDescription and AudioStreamBasicDescription?

What is the difference between CAStreamBasicDescription and AudioStreamBasicDescription? Thanks.

like image 454
André Avatar asked Oct 27 '10 13:10

André


2 Answers

CAStreamBasicDescription is just a wrapper class around AudioStreamBasicDescription. Just look at the .h file usually located at: /Developer/Extras/CoreAudio/PublicUtility/

I usually don't use CAStreamBasicDescription, but use AudioStreamBasicDescription directly. If you are looking for little help on how to fill the AudioStreamBasicDescription structure just use the function FillOutASBDForLPCM.

like image 85
Steph Avatar answered Nov 15 '22 08:11

Steph


Contrary to the first answer I would recommend everyone use CAStreamBasicDescription unless you are completely experienced with CoreAudio, stream formats and how these apply to audio units, and graphs on each platform. So many problems can be avoided by using the wrapper and its many sanity checking and debugging features.

Core Audio Utilities should also be used whenever possible to cut down the number of lines of code you need to write yourself when working with certain Core Audio objects. If nothing else you should use this nice code base as a learning tool to some of the innards of Core Audio.

http://developer.apple.com/library/ios/samplecode/CoreAudioUtilityClasses/Introduction/Intro.html

like image 38
Miles Monroe Avatar answered Nov 15 '22 09:11

Miles Monroe