Matthew van Eerde's web log

  • Matthew van Eerde's web log

    How to enumerate WASAPI Audio Processing Objects (APOs) on your system

    • 0 Comments

    Source and binaries (amd64 and x86) attached.

    Pseudocode:

    main() {
        UINT32 nCount;
        EnumerateAPOs(myCallback, &nCount);
        print nCount;
    }

    ...

    // called once for each APO
    myCallback(PAPO_REG_PROPERTIES props, PVOID pnCount) {
        print props;
        (*pnCount)++;
    }

    Gotcha: the APO_REG_PROPERTIES structure is variable-size.  If you want to store the structure for later use, you need to make the copy before the callback function exits, and make sure add on the size of any additional interface IDs beyond the first (the first is included in the structure) if you want to store them too.

    Output on my system:

    >apoenum.exe
    -- APO properties for CAudioVolume --
        clsid: {06587E71-F043-403A-BF49-CB591BA6E103}
        Flags: 0x0000000f
            APO_FLAG_INPLACE
            APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "CAudioVolume"
        szCopyrightInfo: "copyright (c) 2003 microsoft corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 1
        #1: {D81229B1-5A43-480C-92F7-BE0F7F4EAB60}

    -- APO properties for CAudioConstrictor --
        clsid: {07252659-BB6B-4B79-B78B-623F6699A579}
        Flags: 0x0000000f
            APO_FLAG_INPLACE
            APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "CAudioConstrictor"
        szCopyrightInfo: "Copyright (c) 2003 Microsoft Corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 1
        #1: {6B54B2B5-45EE-4F11-9935-9EC3183AD534}

    -- APO properties for caudiomixer --
        clsid: {12DD4DBB-532B-4FCE-8653-74CDB9C8FE5A}
        Flags: 0x0000000e
            APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "caudiomixer"
        szCopyrightInfo: "Copyright (C) 2003 Microsoft Corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 1
        #1: {C23BDC7A-47F8-49A1-B750-692C35B532C3}

    -- APO properties for CAudioRateConvertCMPT --
        clsid: {27C98999-2895-4829-B080-5A8B65BD3DB0}
        Flags: 0x0000000a
            APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "CAudioRateConvertCMPT"
        szCopyrightInfo: "Copyright (c) 2005 Microsoft Corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 3
        #1: {788F7BE2-9C40-41C0-AF05-4393FBF409F9}
        #2: {C78841EF-516F-4516-B591-F04FA93783A9}
        #3: {7BA1DB8F-78AD-49CD-9591-F79D80A17C81}

    -- APO properties for caudiometer --
        clsid: {3DC09436-7D83-4BA0-ADDC-CD47F996C5BA}
        Flags: 0x0000000f
            APO_FLAG_INPLACE
            APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "caudiometer"
        szCopyrightInfo: "copyright (c) 2003 microsoft corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 0
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 1
        #1: {419B26E3-FA99-4408-83DE-CC1276EFA489}

    -- APO properties for caudioformatconvert --
        clsid: {3FD7F233-A716-472E-8F2F-C25954F34E96}
        Flags: 0x00000006
            APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
        szFriendlyName: "caudioformatconvert"
        szCopyrightInfo: "copyright (c) 2003 microsoft corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 2
        #1: {FC7DFF56-6B8D-45A9-B4CA-266F9AC21693}
        #2: {6BB6A944-7352-4327-AB91-D92607B25656}

    -- APO properties for caudiomatrix --
        clsid: {541987EE-0E02-411E-9A85-1FC6156E7F4B}
        Flags: 0x0000000c
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "caudiomatrix"
        szCopyrightInfo: "copyright (c) 2003 microsoft corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 1
        #1: {BB8B2F5D-2AF0-473F-BD94-F55A77587D3F}

    -- APO properties for WM audio LFX APO --
        clsid: {62DC1A93-AE24-464C-A43E-452F824C4250}
        Flags: 0x0000000d
            APO_FLAG_INPLACE
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "WM audio LFX APO"
        szCopyrightInfo: "Copyright Microsoft"
        u32MajorVersion: 1
        u32MinorVersion: 1
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 1
        #1: {FD7F2B29-24D0-4B5C-B177-592C39F9CA10}

    -- APO properties for WM audio GFX APO --
        clsid: {637C490D-EEE3-4C0A-973F-371958802DA2}
        Flags: 0x0000000d
            APO_FLAG_INPLACE
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "WM audio GFX APO"
        szCopyrightInfo: "Copyright Microsoft"
        u32MajorVersion: 1
        u32MinorVersion: 1
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 1
        #1: {FD7F2B29-24D0-4B5C-B177-592C39F9CA10}

    -- APO properties for caudiorateconvert --
        clsid: {C58BD103-E87F-4B78-A0FA-7A5C95970EE2}
        Flags: 0x0000000a
            APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "caudiorateconvert"
        szCopyrightInfo: "copyright (c) 2003 microsoft corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 3
        #1: {788F7BE2-9C40-41C0-AF05-4393FBF409F9}
        #2: {C78841EF-516F-4516-B591-F04FA93783A9}
        #3: {7BA1DB8F-78AD-49CD-9591-F79D80A17C81}

    -- APO properties for CAudioLimiter --
        clsid: {D69E0717-DD4B-4B25-997A-DA813833B8AC}
        Flags: 0x0000000e
            APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "CAudioLimiter"
        szCopyrightInfo: "Copyright (c) 2003 Microsoft Corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 1
        #1: {7DF8824C-AEC7-4119-9425-E6979172A8AE}

    -- APO properties for caudiocopy --
        clsid: {E916B6B2-22BD-4AFC-B337-D3D9FB27670E}
        Flags: 0x0000000e
            APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
            APO_FLAG_FRAMESPERSECOND_MUST_MATCH
            APO_FLAG_BITSPERSAMPLE_MUST_MATCH
        szFriendlyName: "caudiocopy"
        szCopyrightInfo: "copyright (c) 2003 microsoft corporation"
        u32MajorVersion: 1
        u32MinorVersion: 0
        u32MinInputConnections: 1
        u32MaxInputConnections: 1
        u32MinOutputConnections: 1
        u32MaxOutputConnections: 1
        u32MaxInstances: 4294967295
        u32NumAPOInterfaces: 1
        #1: {ADF7583D-F947-4311-83FB-066AD4E5E7C2}

    APOs found: 12
  • Matthew van Eerde's web log

    How to enumerate Audio Compression Manager (ACM) drivers on your system (spot the bug!)

    • 0 Comments

    Source and binaries (amd64 and x86) attached.

    Pseudocode:

    list acm_drivers;
    acmDriverEnum( myCallbackFunction, &acm_drivers, ...);
        // myCallbackFunction(driver, pacm_drivers) { pacm_drivers->add(driver); }
    for each driver in (acm_drivers) {
        details = acmDriverDetails(driver);
        print details;
    }

    Output on my system - spot the bug!

    >acmenum.exe
    ACM Drivers found: 6
    -- ACM Driver Details: Microsoft IMA ADPCM --
        cbStruct: 1804
        fccType: 0x63647561 (audc)
        fccComp: 0x00000000 (    )
        wMid: 1
        wPid: 34
        vdwACM: 0x03320000 (3.50.12800)
        vdwDriver: 0x04000000 (4.0.0)
        fdwSupport: 0x00000001
            ACMDRIVERDETAILS_SUPPORTF_CODEC
        cFormatTags: 2
        cFilterTags: 0
        hicon: 0x0000000000000000
        szShortName: "Microsoft IMA ADPCM"
        szLongName: "Microsoft IMA ADPCM CODEC"
        szCopyright: "Copyright (C) 1992-1996 Microsoft Corporation"
        szLicensing: ""
        szFeatures: "Compresses and decompresses IMA ADPCM audio data."

    -- ACM Driver Details: Microsoft CCITT G.711 --
        cbStruct: 1804
        fccType: 0x63647561 (audc)
        fccComp: 0x00000000 (    )
        wMid: 1
        wPid: 37
        vdwACM: 0x03320000 (3.50.12800)
        vdwDriver: 0x04000000 (4.0.0)
        fdwSupport: 0x00000001
            ACMDRIVERDETAILS_SUPPORTF_CODEC
        cFormatTags: 3
        cFilterTags: 0
        hicon: 0x0000000000000000
        szShortName: "Microsoft CCITT G.711"
        szLongName: "Microsoft CCITT G.711 A-Law and u-Law CODEC"
        szCopyright: "Copyright (c) 1993-1996 Microsoft Corporation"
        szLicensing: ""
        szFeatures: "Compresses and decompresses CCITT G.711 A-Law and u-Law audio data."

    -- ACM Driver Details: Microsoft GSM 6.10 --
        cbStruct: 1804
        fccType: 0x63647561 (audc)
        fccComp: 0x00000000 (    )
        wMid: 1
        wPid: 36
        vdwACM: 0x03320000 (3.50.12800)
        vdwDriver: 0x04000000 (4.0.0)
        fdwSupport: 0x00000001
            ACMDRIVERDETAILS_SUPPORTF_CODEC
        cFormatTags: 2
        cFilterTags: 0
        hicon: 0x0000000000000000
        szShortName: "Microsoft GSM 6.10"
        szLongName: "Microsoft GSM 6.10 Audio CODEC"
        szCopyright: "Copyright (C) 1993-1996 Microsoft Corporation"
        szLicensing: ""
        szFeatures: "Compresses and decompresses audio data conforming to the ETSI-GSM (European Telecommunications Standards Institute-Groupe Special Mobile) recommendation 6.10."

    -- ACM Driver Details: MS-ADPCM --
        cbStruct: 1804
        fccType: 0x63647561 (audc)
        fccComp: 0x00000000 (    )
        wMid: 1
        wPid: 33
        vdwACM: 0x03320000 (3.50.12800)
        vdwDriver: 0x04000000 (4.0.0)
        fdwSupport: 0x00000001
            ACMDRIVERDETAILS_SUPPORTF_CODEC
        cFormatTags: 2
        cFilterTags: 0
        hicon: 0x0000000000000000
        szShortName: "MS-ADPCM"
        szLongName: "Microsoft ADPCM CODEC"
        szCopyright: "Copyright (C) 1992-1996 Microsoft Corporation"
        szLicensing: ""
        szFeatures: "Compresses and decompresses Microsoft ADPCM audio data."

    -- ACM Driver Details: MPEG Layer-3 Codec  --
        cbStruct: 1804
        fccType: 0x63647561 (audc)
        fccComp: 0x00000000 (    )
        wMid: 172
        wPid: 9
        vdwACM: 0x03320000 (3.50.12800)
        vdwDriver: 0x01090191 (1.9.2305)
        fdwSupport: 0x00000001
            ACMDRIVERDETAILS_SUPPORTF_CODEC
        cFormatTags: 2
        cFilterTags: 0
        hicon: 0x0000000067C507A5
        szShortName: "MPEG Layer-3 Codec "
        szLongName: "Fraunhofer IIS MPEG Layer-3 Codec (decode only)"
        szCopyright: "Copyright ⌐ 1996-1999 Fraunhofer Institut Integrierte Schaltungen IIS"
        szLicensing: ""
        szFeatures: "decoder only version"

    -- ACM Driver Details: MS-PCM --
        cbStruct: 1804
        fccType: 0x63647561 (audc)
        fccComp: 0x00000000 (    )
        wMid: 1
        wPid: 38
        vdwACM: 0x03320000 (3.50.12800)
        vdwDriver: 0x05000000 (5.0.0)
        fdwSupport: 0x00000002
            ACMDRIVERDETAILS_SUPPORTF_CONVERTER
        cFormatTags: 1
        cFilterTags: 0
        hicon: 0x0000000000000000
        szShortName: "MS-PCM"
        szLongName: "Microsoft PCM Converter"
        szCopyright: "Copyright (C) 1992-1996 Microsoft Corporation"
        szLicensing: ""
        szFeatures: "Converts frequency and bits per sample of PCM audio data."

Page 1 of 1 (2 items)

June, 2010