c# - wmplib - 播放 2 个 mp3 文件,但可以将它们放入同步中

发布于 2024-08-27 02:35:10 字数 287 浏览 2 评论 0原文

我有 2 个 windowsMediaPlayer 对象设置 两个对象都有相同的 mp3 歌曲文件,但当我同时播放它们时,它们会不同步几秒钟。我调用来播放它们的代码看起来像这样,这

     sound1.controls.play();
     sound2.controls.play();

是否只是因为一个播放方法在另一个播放方法之前执行,因此一个播放方法比另一个播放方法快。我可以同步它们吗?我已经厌倦了将一首曲目的速率与另一首曲目相匹配,但又无法使其完美。

谢谢

I have 2 windowsMediaPlayer objects setup
Both objects have the same mp3 song file but when I play them at the same time they are out of sync by a few seconds. The code I call to play them looks like this

     sound1.controls.play();
     sound2.controls.play();

Is it just because one play method is executed before the other and thus one fast then the other. Is their anyway I could sync them? I have tired messing with the rate of one track to match the other, but not getting it prefect.

Thanks

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

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

发布评论

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

评论(1

雪若未夕 2024-09-03 02:35:10

你不可能做到如此完美,玩家们在设计上无法同时开始。您需要将这两首歌曲混合成一首新歌曲,NAudio 库可以做到这一点。

You can't get this perfect, the players cannot start at the same time by design. You'll need to mix the two songs into a new song, the NAudio library can do this.

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