Want to integrate TalkState into other mods? Here’s an excerpt from the official README.

If you would like to use this to send talking data to your own mod, you certainly can.

It uses a Memory Linked File @ %temp%\posaudio_mumlink to store a string of the current state. My mod uses the following code to pull the data from the Memory Linked File to the BepInEx Plugin in C#.

static void ReadMemoryMappedFile()
{
    var character = Player.PlayerManager.GetLocalPlayerAgent();
    const string memoryMappedFileName = "posaudio_mumlink";
    const int dataSize = 1024;
    Console.WriteLine($"Initiated RMMF!");
 
    while (true)
    {
        using (var mmf = MemoryMappedFile.OpenExisting(memoryMappedFileName))
        {
            using (var accessor = mmf.CreateViewAccessor(0, dataSize))
            {
                byte[] dataBytes = new byte[dataSize];
                accessor.ReadArray(0, dataBytes, 0, dataSize);
 
                string receivedData = Encoding.UTF8.GetString(dataBytes).TrimEnd('\0');
                // Console.WriteLine($"Received Data: {receivedData}");
 
                if (receivedData == "Talking")
                {
			// do stuff;
                }
            }
        }
        Thread.Sleep(120); // Sleep for 120 milliseconds.
		// Adjust update frequency if CPU performance is bad.
    }
}

I would 100% change the way this updates. GTFO is stinky and requires you to update the values faster than the game in order for it to work, so you shouldn’t have to take such an aggressive approach like I did.