import threading
import mido
midiOutput = mido.open_output("Wwise2MadMapperPort 1")

try:
    client = WaapiClient()
    print("Connected MIDI device: '{}'".format(midiOutput))

except CannotConnectToWaapiException:
    print(
        "Could not connect to Waapi: Is Wwise running and Wwise Authoring API enabled?"
    )

else:
    #Start Profiler
    handler = client.call("ak.wwise.core.profiler.startCapture")

    def GetRTPCsLoop():
        threading.Timer(0.01, GetRTPCsLoop).start()
        arguments = {"time": "capture"}
        result = client.call("ak.wwise.core.profiler.getRTPCs", arguments)

        for i in result.get("return"):
            if i.get("name") == "SomeGameParameter":
                msg = mido.Message('control_change',
                                   control=1,
                                   value=int(i.get("value")) + 48)
                midiOutput.send(msg)
                print("Message: '{}'".format(msg))

    GetRTPCsLoop()
示例#2
0
    initialdir ="C:/",
    filetypes =(("Text File", "*.txt"),("All Files","*.*")), 
    title = "choose your tab Delimited txt file"
    )

# Connect (default URL)
client = WaapiClient()

# RPC
for file in np.asarray(files):
    kwargs = {
        "importLanguage": "SFX", 
        "importOperation": "useExisting",
        "importFile": file,
        "autoAddToSourceControl": True }
    result = client.call("ak.wwise.core.audio.importTabDelimited", kwargs)

    print(result)

# Disconnect
client.disconnect()





'''
# Subscribe
handler = client.subscribe(
    "ak.wwise.core.object.created",
    lambda object: print("Object created: " + str(object))