Exemplo n.º 1
0
__version__ = "$Id$"

import wmfapi
large_int = wmfapi.large_int

# init COM libs
wmfapi.CoInitialize()


# temp debug: find the name of a guid
def findguid(guid):
    for s in dir(wmfapi):
        if s.find("WMMEDIA") >= 0 or s.find("WMFORMAT") >= 0:
            if guid == getattr(wmfapi, s):
                return s


profman = wmfapi.CreateProfileManager()
nprofiles = profman.GetSystemProfileCount()
print nprofiles, 'system profiles:'
for ix in range(nprofiles):
    prof = profman.LoadSystemProfile(ix)
    print ix, prof.GetName()

# find audio pin
prof = profman.LoadSystemProfile(10)
writer = wmfapi.CreateWriter()
writer.SetProfile(prof)
npins = writer.GetInputCount()
audiopinix = -1
audiopinmt = None
Exemplo n.º 2
0
    else:
        reader.Close()
        return None

    # start and duration are in cns == 100 ns
    start = large_int(0)
    dur = large_int(0)
    reader.Start(start,dur,1.0)

    # wait efficiently for completion
    readercbobj.WaitForCompletion()

    reader.Stop()

    agent.doneEncoding()

    # no more python callbacks please
    readercbobj.SetListener()

    del reader

    return outfile


if __name__ == '__main__':
    infile = r'D:\ufs\mm\cmif\win32\wmsdk\wmfsdk\src\testdata\test.wma'
    outfile = r'D:\ufs\mm\cmif\win32\wmsdk\wmfsdk\src\testdata\test.ra'
    wmfapi.CoInitialize() # init com libs if the calling process has not
    convertWma2ra(infile, outfile)
    wmfapi.CoUninitialize()