VoiceRecognitionAPI
Loads Windows Speech recognition into Content Warning and provides a dev-friendly way of using it.
Last updated | 8 months ago |
Total downloads | 101940 |
Total rating | 2 |
Categories | Libraries |
Dependency string | Notest-VoiceRecognitionAPI-1.2.1 |
Dependants | 37 other packages depend on this package |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
VoiceRecognitionAPI
Loads Windows Speech recognition into Content Warning and provides a dev-friendly way of using it.
This is a quick fork
Original creator is LoafOrc! All props go to him. I ported this to Content Warning very quickly, I got permission from the repo owner to reupload it in the Thunderstore. I don't know how to git.
How do I use this
Read the original developer docs
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:
- Make sure you have set your default microphone correctly.
- Enable
LogRecognitionResults
in the mod config, found at(ContentWarningDir)/BepInEx/config/me.loaforc.voicewrapperapi.cfg
. If it is getting wrong results try improving your speech recognition
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 `Content Warning.exe` usually people have it on the C: drive but incase not, change it here-->
<ContentWarningPath>C:\Program Files (x86)\Steam\steamapps\common\Content Warning</ContentWarningPath>
</PropertyGroup>
</Project>
- Then contribute I guess.
- Build look you would a normal mod.
- literally just changed Lethal Company to Content Warning, this feels wrong. This must be wrong.