Skip to content

Latest commit

 

History

History
50 lines (44 loc) · 2.8 KB

README.md

File metadata and controls

50 lines (44 loc) · 2.8 KB

VoiceRecognitionAPI

Loads Windows Speech recognition into Lethal Company and provides a dev-friendly way of using it.

What does this do for players?

In short - nothing. This is a simple API, instead other mods use methods from this mod to build their own features. So go check their feature list to see what voice commands they may offer.

It doesn't work properly help!

If the mod is throwing an error use the github issue page and copy-paste the error in there.

If it is loading correctly but isn't detecting your voice:

Mod Usage

Download the latest dll from the releases tab and add it as a reference to the project. After adding it as a reference you can add it as a reference:

[BepInDependency(VoiceRecognitionAPI.Plugin.modGUID)]
public class YourMod : BaseUnityPlugin { // ...

(Make sure to import it)

Usage

All VoiceRecognitionAPI methods are under the Voice class. It also good to note that they can NOT be defined at runtime. You should register your voice actions when your mod's Awake function is called to make sure they are registered in time. This is how to register a simple voice phrase:

Voice.ListenForPhrase("my cool voice phrase", (message) => {
     logger.LogInfo("You said my cool voice phrase!");
 });

If you'd like to have multiple different phrases to activate the same stuff you can do:

Voice.ListenForPhrases(new string[] { "my cool voice phrase", "my epic voice phrase" }, (message) => {
    logger.LogInfo("Both of those phrase activate this log statement.");
});

Contributing

Uhhh so this is my first time really trying to do a public Github repo so bare with me if I screw something up.

If you'd like to build the mod for yourself:

  • Clone the repo
  • Create a .csproj.user file in the root containing:
<Project>
  <PropertyGroup>
    <!--This should be the path to the folder that contains `LethalCompany.exe` usually people have it on the C: drive but incase not, change it here-->
    <LethalCompanyPath>C:\Program Files (x86)\Steam\steamapps\common\Lethal Company</LethalCompanyPath> 
  </PropertyGroup>
</Project>
  • Then contribute I guess.
  • Build look you would a normal mod.