Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 SDL 2.0 和 SDL_Mixer 编写了一个 C++ 游戏。有时在播放音频时,声音会随机变大。似乎是同时播放多个声音,但我不知道为什么。
这是我调用的两个函数来在我的游戏中播放声音:
void Sounds::play(Mix_Chunk* sound) { Mix_PlayChannel(-1, sound, 0); } void Sounds::play(Mix_Music* music) { Mix_PlayMusic(music, 0); }