Click here to Skip to main content
Rate this: bad
good
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 2:57am
Igor-84425
Rate this: bad
good
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.
 
Regards,
Maxim.
  Permalink  
v2
Comments
Igor-84 at 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 at 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 at 9-Jun-13 20:29pm
   
5ed.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 547
1 ChauhanAjay 180
2 CHill60 135
3 Maciej Los 125
4 Richard Deeming 125
0 Sergey Alexandrovich Kryukov 9,735
1 OriginalGriff 6,987
2 CPallini 5,835
3 George Jonsson 4,017
4 Gihan Liyanage 3,266


Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 3 Oct 2012
Copyright © CodeProject, 1999-2014
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