我的朋友要我为他们测试一个使用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.
答案 0 :(得分:4)
经过多次搜索,我尝试重新安装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
并非在所有情况下都需要所有这些编译选项。您可以通过一次启用一个实验来进行实验,直到找到适用于您的情况的那个。
(我很确定问题中提到的折旧警告与声音的成功或不成功播放无关,因为即使声音播放正在工作,警告仍会显示。)