Skip to content

Python1320/vr_audience_control

Repository files navigation

"Voice Chat" Audience Hot Word Detection Example

Allow voice chat players/audience to control your PC with hot word detection (with minimal CPU usage).

This example makes it so that if someone says "americano" in voice chat, I catch on fire 🔥 in-game. (American accent required)

They can then extinguish 🧯 me by saying "terminator".

See example pronounciation in example_americano_terminator.ogg

image

Notes

  • False positives are common so this is just a toy.
  • No warranty of any kind.

Requirements

  • Something like 30-500MB of extra RAM (python's fault, sorry).
  • The program needs about 1% of CPU power with my old Intel 4th generation i7-4770.
  • Python 3.11+ installed.
  • VRChat avatar knowledge OR programming skills in python to adapt to another game ( Source engine example "coming soon", based on valvecmd )
  • If VRChat:
    • An avatar you have uploaded yourself or an existing OSC parameter (see how to use).
    • Some knowledge about the OSC system
  • If Garry's Mod / TF2:
    • TODO

How to use

  1. Download this repository, extract anywhere.
  2. Run install.cmd
  3. Open %userprofile%\AppData\LocalLow\VRChat\VRChat\OSC and find your Avatar based on the ID.
  4. Find the boolean parameter you want to toggle on/off, in example case:
      ...
       	{
    	  	"name": "fire_effect",
    	  	"input": {
    				"address": "/avatar/parameters/fire_effect",
    				"type": "Bool"
    			  },
      ...
  5. Open main.py and change the /avatar/parameters/fire_effect into your own boolean value.
  6. Optionally: Change keyword
    • Available keywords (Note: new picovoice that requires a license key has way more keywords to choose from. See keywords here):
      • americano
      • blueberry
      • bumblebee
      • grapefruit
      • grasshopper
      • picovoice
      • porcupine
      • terminator
  7. Launch VR BEFORE launching this program (This program uses the primary audio source on launch, which changes when you start VR)
  8. Launch run.cmd or click main.py
  9. Ask someone to say in american accent americano or test with the example sound file example_americano_terminator.ogg
  10. Catch on fire or whatever 🤷

Credits

Based on old version of https://github.com/Picovoice/porcupine/ that does not require a license key. New version would allow using more keywords.

TODO

About

Hot Word Detection from Audience Voice Chat Ingame

Topics

Resources

Stars

Watchers

Forks