Click here to Skip to main content
15,886,714 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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!
Posted

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.
 
Share this answer
 
v2
Comments
Igor-84 4-Oct-12 14:13pm    
Maxim Kartavenkov, specification of my program is to rip radio station. And playing ripped data - it is secondary feature. So, DirectShow is not actual in this case. Can you describe the second option more detailed? How to make performing mp3 data to PCM programmatically? Can you write this function?
Maxim Kartavenkov 5-Oct-12 1:15am    
That doesn't matter for directshow: there you getting the data from is it real time data or file data or data from somethehere else - so I think that you should read the documentation before making words "Not actual" - and rephase to "I haven't knowledge". For playback PCM data there are a lot of DirectSound Samples in SDK so I think there will be enougth. For decoding mp3 you can check the ffmpeg or lame - they are open source.
Sergey Alexandrovich Kryukov 9-Jun-13 20:29pm    
5ed.
—SA
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900