C# 中的 FFmpeg 和 DirectSound/XAudio2
我已经尝试让它工作一段时间了,但有点卡住了。
我试图能够使用 libavcodec 输出到 DirectX 和 DirectSound 或 XAudio2 来播放 C# 中的视频。我已经设法让它播放视频,但我坚持让它输出声音。
我没有使用 DirectSound 或 XAudio2 的经验,或者 libavcodec 的文档很少,这并没有帮助。我已经设法获得音频编解码器,但我一直试图解码它或通过 DirectSound/XAudio2 输出它。
如果有人能够指出我正确的方向,或者只是告诉我如何去做,我将不胜感激。
I have been attempting to get this working for a while and am a bit stuck.
I am attempting to be able to play a video in C# using libavcodec outputting to DirectX and either DirectSound or XAudio2. I have managed to get it to play a video, but am stuck on getting it to output sound.
It doesn't help that I have had no experience with either of DirectSound or XAudio2, or that libavcodec has little documentation. I have managed to get the audio codec, but am stuck trying to decode it or output it through DirectSound/XAudio2.
If anyone is able to either point me in the right direction, or just tell me how to do it I would be grateful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我目前正在做与您大致相同的事情,并且也陷入同一点!我现在可以告诉您的是,如果您还没有找到它,有一个很好的教程,展示如何使用 SDL 进行操作,网址为 FFmpeg 和 SDL 教程,使用 SDL_Audio 进行音频播放。
我正在寻找如何针对 XAudio2 或 DirectSound 进行调整,如果我发现更多内容,我会通知您。目前正在阅读 MSDN 上的官方 XAudio2 文档< /a>.
祝你好运!
I am currently doing approximately the same thing as you and am also stuck at the same point! All I can tell you for now is, if you haven't found it, there's a good tutorial showing how to do it with SDL at An ffmpeg and SDL Tutorial, using SDL_Audio for audio playback.
I am looking to see how to adapt this for XAudio2 or DirectSound and if I find anything more I'll let you know. Am currently reading through the official XAudio2 documentation at MSDN.
Good luck!