如何停止播放使用playsound()函数播放的声音?

发布于 2025-01-28 06:47:59 字数 61 浏览 3 评论 0原文

我使用弹奏()函数播放声音。我该如何停止播放该声音?有什么功能可以完成这项工作吗?

I played a sound using the PlaySound() function. How can I stop playing that sound? Is there any function that can do that job?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苏佲洛 2025-02-04 06:47:59

文档关于pszsound参数:

如果此参数为null,那么当前播放的波形声音都会停止。

遵循该合同,您只需打电话

::PlaySound(nullptr, nullptr, 0);

停止比赛即可。

The documentation has the following to say about the pszSound parameter:

If this parameter is NULL, any currently playing waveform sound is stopped.

Following that contract you simply call

::PlaySound(nullptr, nullptr, 0);

to stop playing.

泪冰清 2025-02-04 06:47:59

您可以使用以下内容:

PlaySound(NULL, NULL, 0);

You can use the following:

PlaySound(NULL, NULL, 0);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文