2

My goal here is to be able to play an MP3 in an OpenTK/OpenGL application (.NET but NOT windows forms), being able to stop/play/pause it, access/set the position of the audio file, and have it play to within a few milliseconds of when I tell it to.

I've tried using WindowsMediaPlayer (WMPLib) but for whatever reason the audio doesn't start playing until I resize or move the window. Not sure why but it probably has something to do with the fact that it's meant to be a control on Windows Forms, and this is a GL application.

I've tried using .NET's soundplayer but that incurs a huge delay of up to a second, and I can't set/access the position of the file.

I've looked into OpenTK and OpenAL but that seems way too complex to figure out.

Does anyone have any ideas?

THANKS!

Oh and worst case scenario I could also deal with playing WAV or OGG files instead, and if the play timing is accurate enough I wouldn't need access to the position of the audio.

4

1 回答 1

0

OpenAL 可能看起来很复杂,但听起来像是解决您问题的最佳方法。它上面有很多,尽管大多数示例可能是其他语言的,但 API 是相同的。也许这个线程也有一些解决方案。

于 2013-06-22T01:34:48.477 回答