If not, how does DirectX relate to DirectShow?
I am trying to learn how to write an audio play/record application. I
see nice introduction to DirectShow in the Microsoft Platform SDK.
But then I see that there is DirectX SDK that can also be used to
write play/record application.
Which one should I learn?
Thanks,
Alex
> Is DirectX and DirectShow the Same Thing (in regard to audio only)?
DirectX is a group of technologies. DirectShow is part of that group.
> If not, how does DirectX relate to DirectShow?
The DirectX SDK no longer contains DirectShow.
> Which one should I learn?
DirectShow. See my site through the link below for more info and links to
most dshow resources. For audio in particular, look at the link to Chris
P.'s site.
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
Simple audio capture & playback can also be accomplished by using
DirectSound, which is in the DirectX SDK.
It really depends on what you are wanting to learn:
- DirectShow is primarily for video/audio playback, capture, and editing. It
is being slowly phased out in favor of the Windows Media Foundation APIs
starting with Windows Vista.
- XAudio2 is a new game-centric audio processing API releasing in the March
2008 DirectX SDK, and is the 'future' of game audio. It's focused on
digitial audio playback and digital signal processing. It does not include
MIDI or capture functionalty.
- DirectSound is the older game audio API, but it is still useful for some
situations. Windows Core Audio is supplanting this API in newer versions of
Windows starting with Windows Vista.
--
Chuck Walbourn
SDE, XNA Developer Connection
This posting is provided "AS IS" with no warranties, and confers no rights.
> Simple audio capture & playback can also be accomplished by using
> DirectSound, which is in the DirectX SDK.
I think most people use dshow though which is why I pointed the OP to it
rather than dsound. (correct me if I'm wrong Chris P.)
> - DirectShow is primarily for video/audio playback, capture, and editing. It
> is being slowly phased out in favor of the Windows Media Foundation APIs
> starting with Windows Vista.
As you note, Vista forwards. There are no plans that I am aware of to port
MF to XP or prior Windows releases which makes it a lame duck for most app
developers. Also, MF does not (yet) have a framework for capture for audio
or video. The major interest in MF so far appears to be from people
interested in Vista's protected media path.
> On Mon, 3 Mar 2008 17:57:30 -0800, Chuck Walbourn [MSFT] wrote:
>
>> Simple audio capture & playback can also be accomplished by using
>> DirectSound, which is in the DirectX SDK.
>
> I think most people use dshow though which is why I pointed the OP to it
> rather than dsound. (correct me if I'm wrong Chris P.)
It mainly comes down to file format support. If you want to support
multiple file formats and compression methods then DirectShow has a clear
advantage. If you are strictly using a single file format like WAV with no
compression then I'd skip DirectShow in favour of a simpler API.
>> - DirectShow is primarily for video/audio playback, capture, and editing. It
>> is being slowly phased out in favor of the Windows Media Foundation APIs
>> starting with Windows Vista.
>
> As you note, Vista forwards. There are no plans that I am aware of to port
> MF to XP or prior Windows releases which makes it a lame duck for most app
> developers. Also, MF does not (yet) have a framework for capture for audio
> or video. The major interest in MF so far appears to be from people
> interested in Vista's protected media path.
I agree. There will be general adoption of MF but not until it has general
support, back porting is required for such support. If they continue to
back port new features to Vista at least then it might start getting some
take up in 3-5 years.
--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
> If you are strictly using a single file format like WAV with no
> compression then I'd skip DirectShow in favour of a simpler API.
You'd Probably use the waveIn/waveOut/mixer APIs rather than dsound though,
correct?
> You'd Probably use the waveIn/waveOut/mixer APIs rather than dsound though,
> correct?
When latency is not a concern, yes. If targeting Vista only I would
consider using WASAPI as it is one level closer to the hardware.
Things start to become clearer but I think that I need another
iteration of clarification:
I was aware that once upon a time there was waveIn/waveOut (MCI?).
Then it was replaced by something more advanced (DirectSound?) but I
had no idea that there was something in between called DirectShow
(where was I sleeping?)
So, I just need to clarify the following:
Is it correct to say that there are two audio API *families*: gaming
and non-gaming?
If so, then the non-gaming generations would go something like this:
waveIn/waveOut > DirectShow > Windows Media Foundation
And the gaming generations would go like this:
waveIn/waveOut > DirectSound > XAudio2 > Windows Core Audio
Did I get this right?
If not, what did I miss?
Thanks,
Alex
On Mar 4, 2:00 pm, "Chris P." <m...@chrisnet.net> wrote:
> On Tue, 4 Mar 2008 11:49:25 -0700, The March Hare [MVP] wrote:
>
> > You'd Probably use the waveIn/waveOut/mixer APIs rather than dsound though,
> > correct?
>
> When latency is not a concern, yes. If targeting Vista only I would
> consider using WASAPI as it is one level closer to the hardware.
>
> --http://www.chrisnet.net/code.htm
> If so, then the non-gaming generations would go something
[...]
Not quite, it's more like:
- audio I/O, at different levels
-- waveIn/waveOut -> WASAPI (and the rest of the Windows
Core Audio APIs in Vista)
-- DirectSound -> XACT2
- video output
-- GDI -> DCI -> DirectDraw -> Direct3D
- video input
-- VideoForWindows -> WDM/KS + BDA
- multimedia frameworks, which use the above audio/video I/O
APIs under the hood
-- ACM + VCM + MCI -> DirectShow -> MediaFoundation
- media formats
-- VideoForWindows (AVI+WAV) -> WindowsMedia (ASF)
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
> So, I just need to clarify the following:
>
> Is it correct to say that there are two audio API *families*: gaming
> and non-gaming?
>
> If so, then the non-gaming generations would go something like this:
>
> waveIn/waveOut > DirectShow > Windows Media Foundation
>
> And the gaming generations would go like this:
>
> waveIn/waveOut > DirectSound > XAudio2 > Windows Core Audio
>
> Did I get this right?
Kind of. You're pretty close on the gaming, except that XAudio2 is brand
new and not about to be replaced. On Vista they do have the choice to use
Core Audio instead but XAudio2 presents a nice easy wrapper over the down
and dirty system API's.
DirectShow, once known as ActiveMovie (Quartz) wasn't a replacement. It
was a new architecture to handle multimedia playback in a nice modular
fashion. It has filters that wrap system components such as waveIn/waveOut
and DirectSound output. Additionally it has filters designed for handling
specific file types to make multimedia file I/O easier. Additionally it is
extensible so you can write new filters to handle new file formats or do
specific tasks. So it really sits at a level above everything else. The
real reason it was dropped from games (before a replacement was available)
was codec hell. The games made presumptions that certain decoders were
available on the system and couldn't do anything about it if they weren't.
There's solutions to that problem such as using a decoder you can get
distribution rights to.
So really the evolution is:
System Audio
waveIn/WaveOut -> (DirectSound) -> Core Audio
Game Audio
waveIn/WaveOut -> DirectSound -> XAudio2
Multimedia Wrappers
MCI -> DirectShow -> Media Foundation (someday)
--