搜索后找到了對應的解決方案,原話是這樣的
If you built your own SDL, you probably didn’t have development headers
for PulseAudio (or ALSA), so it’s trying to use /dev/dsp, which doesn’t
exist on many modern Linux systems (hence, SDL_Init(SDL_INIT_AUDIO)
succeeds, but no devices are found when you try to open one). “apt-get
install libasound2-dev libpulse-dev” and rebuild SDL…let the configure
script find the new headers so it includes PulseAudio and ALSA support.
其實說白了就是你編譯的環境默認使用dsp設備播放,但是由於現代操作系統已經不支持dsp了
你需要安裝 libasound2-dev libpulse-dev這些庫使SDL能使用PulseAudio播放.
解決辦法
sudo apt install libasound2-dev libpulse-dev