CAStreamBasicDescription 和 AudioStreamBasicDescription 有什么区别?
CAStreamBasicDescription
和 AudioStreamBasicDescription
之间有什么区别?谢谢。
What is the difference between CAStreamBasicDescription
and AudioStreamBasicDescription
? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CAStreamBasicDescription 只是 AudioStreamBasicDescription 的包装类。只需查看 .h 文件,通常位于:
/Developer/Extras/CoreAudio/PublicUtility/
我一般不使用CAStreamBasicDescription,而是直接使用AudioStreamBasicDescription。如果您正在寻找有关如何填充 AudioStreamBasicDescription 结构的帮助,只需使用函数 FillOutASBDForLPCM 即可。
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.
与第一个答案相反,我建议每个人都使用 CAStreamBasicDescription ,除非您对 CoreAudio、流格式以及它们如何应用于每个平台上的音频单元和图形完全有经验。通过使用包装器及其许多健全性检查和调试功能可以避免很多问题。
还应尽可能使用核心音频实用程序,以减少在使用某些核心音频对象时需要自己编写的代码行数。如果不出意外,您应该使用这个不错的代码库作为学习 Core Audio 一些内部结构的工具。
http://developer.apple.com/library/ios/samplecode /CoreAudioUtilityClasses/Introduction/Intro.html
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