Python connect to Fmod project

I wanna find a way to control FMOD project from python. For example, i develop a python app, it will has ability to command Fmod Studio to build banks, or make events for users.
Because we have group of people need to use fmod project but not all people have fmod studio app.

In addition, Is it possibile to live updates assets from daw without opening fmod studio?

I found that it is possibile to connect FMOD studio by port 3663, but i dont’t know how could Fmod studio respond the connection. Could you please give me an example that if fmod studio can print “HelloWorld” in console window when clients establish connection to fmod studio. And i want to know how fmod studio can continue listening to the connection.

Thank you so much

As mentioned in the Terminal Interface section of the Studio Scripting Reference, you can send data to Studio via TCP/IP over port 3663, which will be interpreted as Javascript encoded in UTF8. This will give you access to all the normal console commands - a “Hello World” command should be as simple as sending console.log("Hello World").

If you render or modify assets in your assets directory, FMOD Studio should automatically detect changes and update accordingly, though some files may need to be refreshed/imported. Additionally, we have a Reaper integration, which will allow you to link your Reaper project and its renders to your FMOD Studio project, and export Reaper timelines to events.

1 Like

I understand, thank you very much!
By the way, may i ask that how FMOD studio can give a respond to the client. For example, a client ask for an event name of GUID, fmod will give a respond to this client.

What’s more, when ‘Live Update’ is enabled in FMod, can FMod request Unity to release and reload the currently playing resources, allowing me to make real-time changes to this resource in other DAWs?

This may depend on what Python functionality you’re using to connect and send commands via TCP/IP. For example, using Packet Sender, I am able to view the output of the console after sending commands to Studio. While I assume it is possible, I’m unsure it’s possible to view the console output with the Python functionality you’re using.

As for executing specific commands, if there is no existing single command in the API, you will need to handle it as a combination of more complex commands yourself. For example, you can use studio.project.lookup() to look up a ManagedObject using a path or GUID, but you will need to retrieve the information you want from the ManagedObject yourself. You can send these commands together:

var myGUID = "{your-event-guid-here}"
var object = studio.project.lookup(myGUID);

If you’re connected to a game using Live Update, and make changes to the project in FMOD Studio, the changes will automatically be sent to the running game. This should include changes made to assets.

If FMOD doesn’t send any information outward, we won’t see any output in the Python client. What i want to ask is that if FMOD Studio can send messages externally through JavaScript. It seems there isn’t a method for that currently; while external control of FMOD Studio via TCP/IP is possible, FMOD Studio doesn’t seem to respond outwardly. I think exploring Wwise’s WAAPI might be beneficial. It’s very useful for programmers to create auxiliary tools as it allows other clients to interact with Wwise, and Wwise will return the required information to the client. This wouldn’t be difficult for you as there are already methods to control FMOD Studio using TCP/IP to execute JavaScript-related code. You’d just need to add some APIs that FMOD can use to transmit information externally

Apologies if I was unclear: yes, you should be able to read console output in your Python client by reading from the socket FMOD Studio is using. You can see an example of this (in C#) used in our Unity integration in EditorUtils.GetScriptOutput(), where we use NetworkStream to send commands to and read the output from FMOD Studio via 127.0.01:3663.

1 Like

Thanks a lot, i got you!