SoX 与 OpenAL 性能/开销
两者都有 C 语言的绑定,都可以播放各种格式。
哪一个更优越呢?在简单性、性能、开销和内存占用方面。
另外,哪一个更适合处理多个流?
Both has bindings for C, both can play various formats.
Which one is more superior? in terms of simplicity, performance, overhead and memory footprint.
Also which one is better at handling multiple streams?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我没有使用其中任何一个进行编程,但我相信 OpenAL 的设计目的是为游戏渲染和输出多通道音频,并以实时性能为要求。
libSoX 更多的是用于音频文件的输入和输出,以及格式转换。有很多插件,但据我所知,它并不是为实时音频输出而设计的。不过,使用起来似乎要简单得多。
您可能还想查看 libsndfile。
你到底想做什么?
I have not programmed with either of those, but I believe that OpenAL has been designed to render and output multiple-channel audio for games, with real-time performance as a requirement.
libSoX is more for input and output from audio files, as well as for format conversions. There are lots of plugins but AFAIK it has not been designed for real-time audio output. It seems significantly simpler to use, though.
You might also want to have a look at libsndfile.
What exactly is it that you want to do?
虽然我从未使用过 OpenAL,但我听说过很多关于它的坏话,这使得它听起来不专业,基本上是一个死胡同。来自维基百科:
还有一个问题是它会扰乱调用应用程序的状态;我相信仅仅链接它就会导致一些全局构造函数在调用
main
之前运行,从而改变程序的初始环境,并破坏一些程序(也许是 MPlayer?)。我不清楚这个问题是否已经得到解决,但它尖叫着糟糕的图书馆,我对是否相信历史上包含此类滥用行为的图书馆持怀疑态度。While I have never used OpenAL, I've heard a lot of bad things about it that make it sound unprofessional and basically a dead end. From Wikipedia:
There was also an issue with it messing up the state of the calling application; I believe just linking it caused some global constructors to run before the invocation of
main
in a way that altered the program's initial environment, and broke some programs (MPlayer perhaps?). It's unclear to me whether this issue was ever fixed, but it screams bad library and I would be skeptical of ever trusting a library historically contained such abuses.