Audio/Video Playback with seeking in XNA

做~自己de王妃 提交于 2019-12-12 12:28:02

问题


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:


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



来源:https://stackoverflow.com/questions/9353583/audio-video-playback-with-seeking-in-xna

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!