JUCE is an open-source cross-platform C++ application framework used for rapidly
developing high quality desktop and mobile applications, including VST, AU (and AUv3),
RTAS and AAX audio plug-ins. JUCE can be easily integrated with existing projects or can
be used as a project generation tool via the Projucer,
which supports exporting projects for Xcode (macOS and iOS), Visual Studio, Android Studio,
Code::Blocks, CLion and Linux Makefiles as well as containing a source code editor and
live-coding engine which can be used for rapid prototyping.
安装也很简单
Getting started
Download JUCE. Unpack the JUCE folder
and place it to some location on your computer.
Your user home folder is a convenient place.
Go into the JUCE folder you just installed.
Launch the Projucer, which is located there.
我建议使用跨平台多媒体库SDL,它适用于所有操作系统(Windows、Linux、MacOS、iOS、Android)。它是用 C 编写的,可以在 C 和 C++ 中使用。
我在下面写了一个小型包装库,这个迷你库的目的是展示一个使用 SDL 播放音频文件的示例,以及提供现成的方便函数,用于通过单个函数调用播放文件。我的库只播放 WAV 声音文件,为简单起见,如有必要,它也可以修改为 MP3 和其他格式。SDL 支持它们。
库中有 3 个函数 - PlayWavFile - 从由名称指定的文件中播放 WAV 文件,PlayWavMem - 播放位于内存中的 WAV 文件,PlayWavError - 返回错误文本(更准确地说,完整的错误堆栈以及随附的解释性消息) .
播放声音的主要功能在文件
PlayWavRW()内部play_wav.c,这是中心功能,您可以阅读它以了解如何在 SDL 中播放声音。我的库的其余函数和宏只是辅助的(例如,用于汇编和错误输出)。为了使我的库正常工作,需要执行以下步骤:
sudo apt install libsdl2-dev.gcc -o play_wav_usage_example play_wav_usage_example.c play_wav.c -lSDL2。./play_wav_usage_example,它需要附近的文件sound.wav才能播放。使用play_wav_usage_example.c的示例:
头文件play_wav.h:
实现函数play_wav.c的文件:
Gstreamer 并不像看起来那么大,但用途广泛:
在构建环境中安装
使用 ogg、vorbis、opus、theora 编解码器在运行时安装(10 兆字节)
编译
内存分配 12 兆字节与编解码器和所有库。
不知道目的是什么,但是可以使用已经安装好的软件,我觉得从C调用进程是没有问题的
至于音频库,我曾经尝试过 - https://juce.com/
安装也很简单
如果问题的价格不麻烦,那么我可以提供 Un4seen 的低音音频。
https://www.un4seen.com/bass.html
优点 - 一个极其简单易懂的 API,文档齐全,作为单个 dll/so 文件分发,具有播放任何音频文件、多线程和跨平台的巨大潜力。(我们经常在大型android/ios游戏中使用它)
缺点 - 昂贵。但她值得。
关于文档,对于开发人员来说是一个单独的加分点,即使是刚在不到一周的时间内进入项目的初学者也可以自由地开始使用库 API。