Click here to Skip to main content
13,351,156 members (25,028 online)
Rate this:
Please Sign up or sign in to 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 1-Oct-12 3:57am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


You will be needing the DirectX SDK and you can go to this site[^] for the detailed tutorial on how to play audio files using directx.

Hope this helps, Thanks!


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180111.1 | Last Updated 3 Oct 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100