C++用于播放/录制音频的多平台库(.wav、.ogg)
我有一个多平台应用程序,想要添加音频注释功能。 我正在寻找音频播放/录音库,即:
- 多平台(Windows、Linux、Mac)
- 简单快速地集成到现有项目中
- 不要使用 cygwin for Windows 构建
- 有 C++ 绑定
我看到了 gstreamer 但我感觉对于我的简单用例来说它太先进了
I have a multiplatform application and want to add audio annotations functionality.
I am looking for audio playback /recording library that is:
- multiplatform (Windows, Linux, Mac)
- simple and fast to integrate into existing project
- do not use cygwin for Windows build
- has C++ bindings
I saw gstreamer but I have the feeling that is it too advanced for my simple use cases
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否研究过SDL?应该能够播放OGG文件和WAV 文件。
Did you look into SDL? That should be able to play OGG files and WAV files.
我使用过 sox,但目前在 Mac 上录制时似乎无法正常工作。如果您可以在没有它的情况下从设备进行录制,那么它具有很好的文件处理功能。
PortAudio 用于备受瞩目的声音应用程序 Audiomulch。
我没有使用过 RtAudio,但我使用过使用它的项目。它处理 JACK、CoreAudio、ALSA、OSS、DirectSound 和 ASIO。
libsndfile 是需要处理音频文件作为 sox 替代方案的项目的常见依赖项。
I have used sox, but it seems currently broken for recording on Macs. If you can record from your device without it, it has nice file-handling features.
PortAudio is used in a high-profile sound app, Audiomulch.
I haven't used RtAudio, but I've used projects that use it. It handles JACK, CoreAudio, ALSA, OSS, DirectSound, and ASIO.
libsndfile is a common dependency for projects that need to deal with audio files as an alternative to sox.
我确信 ffmpeg 符合要求。格式支持几乎是无限的,并且它已经证明了它的价值。不幸的是,它需要一个类似 UNIX 的 shell 来构建。不过,您不需要 Cygwin,但可以使用 MSYS,您可以找到最新的二进制发行版 此处。对于简单的音频(录制)功能来说可能有点过分了,但是您提到了支持不同格式的能力。您无法使用 Visual C++ 编译器编译 ffmpeg,但一旦 GCC 或其他 C99 兼容编译器构建了库,您就可以使用它。
I'm sure ffmpeg fits the bill. Format support is near infinite and it has proven its worth. Unfortunately, it will need a UNIX-like shell to build. You don't need Cygwin though, but can use MSYS for that, for which you can find an up-to-date binary distribution here. It may be overkill for simple audio (record) functionality, but you mention the ability to support different formats. You cannot compile ffmpeg with Visual C++ compilers, but you can use it once the library is built by GCC or other C99 compliant compiler.