在 C++/Direct X 中使用 XACT 制作简单的 2D 游戏

发布于 2024-11-03 16:38:18 字数 171 浏览 11 评论 0原文

我正在尝试将我制作的声音效果放入我的游戏中。我有一个类似行走的声音,我想在用户行走时循环播放,一旦用户停止行走,我希望声音停止。我浏览了有关使用 XACT 的 DirectX 教程,但它没有回答我的问题。在我的代码中,我尝试使用播放功能,当它们不移动时,我停止行走的声音。发生的情况是,即使我停止移动,它也只会播放整个声音片段。

I'm trying to take sound effects I have made and put them into my game. I have a sound like walking that I want to loop while the user is walking and once the user stops walking, I want the sound to stop. I went through the DirectX tutorials on using XACT but it does not answer my question. In my code I try to use the play function and when they are not moving i stop the walking sound. What happens with this is it just plays the whole sound clip even when i stop moving.

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

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

发布评论

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

评论(1

亢潮 2024-11-10 16:38:18

您是否使用 XACT_FLAG_STOP_IMMEDIATE 标志?

Are you using the XACT_FLAG_STOP_IMMEDIATE flag?

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