Partager via


Decoder Volume Control

 
Microsoft DirectShow 9.0

Decoder Volume Control

Applications control audio volume through the IBasicAudio interface. An IBasicAudio interface handler is provided for KSProxy. For a decoder to handle the volume commands from KSProxy, it must add several registry keys in its setup script and support the KSPROPSETID_Wave property set.

Create some new registry keys for the driver:

  HKLM\SYSTEM\
    CurrentControlSet\Control
      DeviceClasses
        (decoder guid, eg 2721AE....)
          (Pnp id, eg ##?#VDGENDEV#...)
            #GLOBAL
              Device Parameters
                CLSID      REG_SZ   {17CCA...}
                  FriendlyName   REG_SZ   WDM DVD Driver
                    Interfaces <--- create this key
                    {b9f8ac3e-0f71-11d2-b72c-00c04fb6bd3d} <-- also create this key, it is not a value)
      MediaInterfaces
        {b9f8ac3e-0f71-11d2-b72c-00c04fb6bd3d} <-- create this key
          (default)        REG_SZ    'KsProxy IBasicAudio handler' <-- set this value
          IID    REG_SZ    56 a8 68 b3 0a d4 11 ce b0 3a 00 20 af 0b a7 70    <-- create this string value

To implement volume control, the driver also must support KSPROPSETID_Wave, along with KsProperty.Id = KSPROPERTY_WAVE_VOLUME. This property is passed to the driver through the IKsPropertySet::Get and IKsPropertySet::Set methods. The LeftAttenuation and RightAttentuation fields specify the left/right speaker volumes as linear values from 0x0000 to 0xffff.