使用DirectSound或DirectShow播放mp3和aac [英] Playing mp3 and aac using DirectSound or DirectShow

查看:388
本文介绍了使用DirectSound或DirectShow播放mp3和aac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!我有一个问题-如何使用DirectSound或DirectShow播放mp3和aac文件(在同一时间下载的文件)?
我对DirectShow的实验表明,DirectShow不会播放当前正在填充数据的文件.
DirectSound支持流播放,但同时无法播放mp3.
我的问题有什么解决办法吗?

Hello! I have a question - how to play mp3 and aac files (that downloaded in the same time) using DirectSound or DirectShow?
My experiments with DirectShow showed that the DirectShow does not play files that are currently filling with data.
And DirectSound supports streamed playing, but in the same time isn''t capable for playing mp3.
Is there any solution of my problem?
Great thanks!

推荐答案

您错了DirectShow.
使用DirectShow可以毫无问题地做到这一点:您应该编写过滤器,该过滤器的作用是将下载的数据提供给上游过滤器.

DirectShow使用DirectSound进行播放,但是独立的DirectSound不会执行解码(mp3或aac),因此要使用DirectSound,您应该手动执行解码.

但是为此,您可以使用ffmpeg;因此,您可以通过ffmpeg执行解码块的下载,并将PCM数据提供给DirectSound或winmm.

但是我认为通过DirectShow使它更胖.

问候,
Maxim.
You are wrong abt DirectShow.
That is possible to make using DirectShow without problems: you should write filter which will do providing data, you downloading, to upstream filters.

DirectShow uses the DirectSound for playback, but standalone DirectSound does not performs the decoding (mp3 or aac), so to use DirectSound you should manually performs the decoding.

But for that you can use ffmpeg; so you can performing downloading decode chunks via ffmpeg and provide PCM data into DirectSound or winmm.

But my opinion that to make that via DirectShow much fater.

Regards,
Maxim.




您将需要DirectX SDK,并且可以转到此站点 http://doc. 51windows.net/Directx9_SDK/?url=/directx9_sdk/htm/directmusicctutorials.htm [
Hi,

You will be needing the DirectX SDK and you can go to this site http://doc.51windows.net/Directx9_SDK/?url=/directx9_sdk/htm/directmusicctutorials.htm[^] for the detailed tutorial on how to play audio files using directx.

Hope this helps, Thanks!


Nexus,
codedoppler.blogspot.com


这篇关于使用DirectSound或DirectShow播放mp3和aac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆