使用来自 Homebrew 的 sdl2_mixer 没有声音

No sound using sdl2_mixer from Homebrew

我的朋友让我为他们测试一个使用 sdl2_mixer 声音的程序。我正在使用 OS X 10.11.

我从 Homebrew 安装了 sdl2_mixer,但是当我 运行 程序时,没有声音。

我们已尝试 .mp3.ogg 个文件,但无济于事。

显示此警告,但我不知道它是否与问题有关:

This application, or a library it uses, is using the deprecated Carbon
Component Manager for hosting Audio Units. Support for this will be 
removed in a future release. Also, this makes the host incompatible with 
version 3 audio units. Please transition to the API's in AudioComponent.h.

编辑:
显然这不再起作用了。请参阅下面 Mike 的评论。


经过大量搜索,我尝试重新安装 sdl2_mixer,并在 Homebrew 中启用了可选的编译选项。

首先,我用

删除了sdl2_mixer的原始安装
brew remove sdl2_mixer

那我运行

brew --info sdl2_mixer

找出我可以启用哪些编译选项。

最后,我用

重新安装了 sdl2_mixer
brew install sdl2_mixer --with-flac --with-fluid-synth --with-libmikmod \
--with-libmodplug --with-libvorbis --with-smpeg2

并非所有这些编译选项在每种情况下都是必需的。您可以通过一次只启用一个来进行试验,直到找到适合您情况的那个。

(我很确定问题中提到的折旧警告与声音播放成功或失败无关,因为即使声音播放正常也会显示警告。)