我正在用 C# 开发一个 XNA 节奏游戏,因为它是一个节奏游戏,所以需要一个歌曲编辑器,这需要精确的视频和音频。音频搜索和继续播放歌曲。我尝试了 MediaPlayer 和 VideoPlayer 类,但它们都无法寻找特定位置,因为 PlayPosition 是只读的。
有谁知道实现这一目标的好方法?另外,它需要能够播放 .mp3 文件,所以我不能使用 XACT。节奏游戏 osu!也是用 XNA 编码的,并且以某种方式它可以播放 mp3 文件并允许查找。
编辑:顺便说一下,这是专门针对 PC 的
编辑2:另外,我使用的是 XNA 4.0
I'm developing an XNA rhythm game in C# and because it's a rhythm game it's gonna need a song editor, which is going to need precise video & audio seeking & resuming for the songs. I tried MediaPlayer and VideoPlayer classes but both of them cannot seek a specific position, as PlayPosition is read only.
Does anyone know a good way to achieve this? Also, it needs to be able to play .mp3 files, so I can't use XACT. The rhythm game osu! is also coded in XNA and somehow it plays mp3 files and allows seeking as well.
EDIT: By the way, this is specifically for PC
EDIT2: Also, I'm on XNA 4.0
发布评论
评论(1)
由于您使用的是 PC,因此您可能可以进行互操作以与核心 DX 功能进行对话。我不知道这与 XNA 的配合效果如何,但如果有任何希望它能发挥作用,可能会与
Microsoft.DirectX.AudioVideoPlayback.Video
类一起使用:http://msdn.microsoft.com/en-us/library/windows/desktop/ms902629.aspx
Since you're on PC, you can probably interop out to talk to the core DX functionality. I don't know how well this will play with XNA, but if there's any hope of it working, it would probably be with the
Microsoft.DirectX.AudioVideoPlayback.Video
class:http://msdn.microsoft.com/en-us/library/windows/desktop/ms902629.aspx