Re: Enumurating Audio devices like DirectSound using DirectShow



On 18 Apr 2005 01:07:45 -0700, Tareq Ahmed Siraj wrote:

> Hi all,
> I'm very new to DirectShow programming and did some DirectSound
> programming in the past. So please correct me if i am wrong with
> anything.
> I'm creating an application for rec/playback supporting audio
> compression through directshow filters. I've used the code from "Using
> the System Device Enumerator" documentation and for rendering devices,
> i get 4 devices for my 1 sound card (1. Default DirectSound Device, 2.
> Default Waveout device, 3. DirectSound: SoundMAX Audio, 4. SoundMax
> Audio). But in DirectSound, I get 2 devices (1. Primary Sound Driver,
> 2. SoundMax Audio) which is more convenient for the user. Is there any
> way to get this list like directsound does? Currently, the only
> solution I can think about is string comparing the FriendlyName with
> the ones i dont want in the list. Just wondering... why does Default
> DirectSound device show up in DirectShow enumuration instead of
> DirectSound Enumuration?

Yes the defaults are called different things, don't ask me why :) The
reason things show up twice is because both WinMM and DirectSound are
enumerated. All DirectSound device outputs are prefixed with
"DirectSound:" except for the default which is always called "Default
DirectSound Device". The default has the highest merit.

> Another thing is, In DirectSound, we get a GUID associated with the
> sound driver. Here, I only get a IMoniker* ... how do i retrieve the
> GUID associated with the specific sound device? and if possible to
> retrieve the GUID, is it possible to create a basefilter from the GUID
> from that device?

You can create a IBaseFilter pointer by calling BindToObject(). If you are
creating a user list for example, store the IMoniker* and when the user
selects the device call BindToObject() with the IMoniker*. If your only
interested in DirectSound outputs then filter out the WinMM devices using
string comparison (not graceful but it works).
IBaseFilter *pRenderer=NULL;
hr = pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&pRenderer);

> Also, I'm wondering what other properties i can read from the property
> bag other than FriendlyName.

You can retrieve the CLSID, but it is not the DirectSound GUID. All
DirectShow audio renderers have the exact same CLSID except for custom
renderers. You can also retrieve the FilterData which contains the Merit
and some other standard DirectShow information.
.



Relevant Pages

  • Re: corrispondence between Multimedia HMIXER and DirectSound GUID
    ... but I can't map the devices this way. ... In the DirectSound enumerate, the description of two devices with the same ... and then query the GUID of the Preferred Playback Device in the Direct ... > get a GUID of a mixer device. ...
    (microsoft.public.win32.programmer.mmedia)
  • Enumurating Audio devices like DirectSound using DirectShow
    ... I'm very new to DirectShow programming and did some DirectSound ... SoundMax Audio) which is more convenient for the user. ... GUID associated with the specific sound device? ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: More Vista-DirectShow-Audio Woes....
    ... application to allow the user the select a different audio renderer. ... choosing a non-DirectSound renderer overcomes the issues I was ... DirectSound performance is very poor under Vista). ... DirectShow application to enable device selection based on device role. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: WMA Decoder In Application
    ... You can still play WMA files through the waveform audio driver ... without DirectSound. ... Why put extra effort into a driver that will be abandoned if you ...
    (microsoft.public.windowsce.platbuilder)
  • How the mpeg2 DVD codec operates inside MCE..
    ... You can configure the audio codec "on the fly" inside MCE ... DirectSound where PCM sources are mixed as well and then forwarded to the ... Sound renderer in Direct Sound mode ... PCM and DirectSound is restored. ...
    (microsoft.public.windows.mediacenter)

Loading