gpt4 book ai didi

c++ - 在 C++ 中播放声音......但是,游戏在播放声音时停止......我怎样才能阻止这种滞后?

转载 作者:可可西里 更新时间:2023-11-01 18:26:38 26 4
gpt4 key购买 nike

声音是使用:

PlaySound(TEXT("C:\\hitBrick.wav"), NULL, SND_FILENAME);

最佳答案

正如 Ville Krumlinde 所说,像这样使用 SND_ASYNC:

PlaySound(TEXT("C:\hitBrick.wav"), NULL, SND_FILENAME | SND_ASYNC);

看看:http://msdn.microsoft.com/en-us/library/windows/desktop/dd743680%28v=vs.85%29.aspx

SND_ASYNC The sound is played asynchronously and PlaySound returns immediately after beginning the sound. To terminate an asynchronously played waveform sound, call PlaySound with pszSound set to NULL.

关于c++ - 在 C++ 中播放声音......但是,游戏在播放声音时停止......我怎样才能阻止这种滞后?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16038321/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com